Bugfixes to stop_server, now works for running servers