Fix damage calculation bug