Fixed a problem where `sum` used with a `group` was not returning a Hash.

\cc @senny