Fix Context for multi phase aggregation queries