Cleaned up server beforeShutdown() behavior.