Fixed some errors so the SUM compiles again