Fix totals calculation
Merge pull request #69 from jarmokortetjarvi/backend

Fix totals calculation