Fix quit on mac.