Fix Sorting in totals