Fix issue that prevented the server from stopping