Minor changes in the code related to the aggregates in the query builder