Fix rounding issues on total row

* Use actual percentages to calculate the total to ensure
  the rows average matches the totals average

Fixes #596