Fixed the quitting stuff