Set application instance first (to prevent a NPE in BaseRegistry)