Fixed a bug that made the main window not open up.