Misc cleanup of the AI server.