Fix issue with total hardcoded to zero