Fixed crash with quit();