Fix type of variable for histograms with large number of entries.