Fix OSX event loop