Adds checks for non-aggregate attributes with aggregation