Fix total payout calculation bug