Fixed the hang on quit.