Correctly quit application.