Test aggregation with bad query