Fixed quitting the application in Simulator.