Updated histogram quantile method for better consistency between 1D and ND histograms.