Fix bug in battle.