aggregation bug fixes