Fix to allow nested aggregates, i.e. aggregates over a subquery containing an aggregate.