Implemented graceful quitting of clients.