Fixes error when calling sum with values not known until apply time. Also allows sum to cope with numbers too large to represent in float64, along with correctly handling errors when trying to sum opposing infinities.