Fix bug when aggregating over zero rows. (Fixes #1)