Fix aggregate ordering