Fixed creation order of main window and application controller.