Improved loading of histograms.

Signed-off-by: aywu <aywu477@gmail.com>