Fix seg fault when loading application instance.