Fixes https://github.com/HdrHistogram/HdrHistogram/issues/42 and adds test