Fix bug with totals.