Fixes to total sum