Server: fix detecting when it's been stopped using srv.Stop()
fix tests