Fixed a bug where the game loop would only execute after the the main window is closed.