Simplify sum and average

I don't get the rational of 0 mean for empty set by the way. I'd expect an error or infinity :/