Fixed weird error that was causing the histogram to break in certain cases.