Fixed bug relating to groupBy.