fix some overflows in the histogram
Merge pull request #22 from bgirard/fix-some-overflows

fix some overflows in the histogram