fixed  bug in sum functions. Sum is now initialized to 0 instead of the Minvalue of the type (copy/paste bug)