Cleanup of server code.