Improve server shutdown.