Bugfix for grouping by "_id" in Metric queries