Attempt to fix exceptions in doQuit()