add bin index adjustment to guard agains numeric errors in histogram.