Made Server.quit() more robust.