fixes for aggregation stuff