Added fix to prevent an error trying to sum nil values.