More cleanup of MainBot.