Fixed logic in setDamage()