Fix error in battle engine