More robust handling of server state