Quitting and a proper event loop.