Fix some mode changes crashing the bot.