Merge "Merge very similar code in test_aggregates_negative"