Fixing wrong total computation