Bugfix total calculation