Fix groupBy with histograms