Fixed a few aggregation bugs.