Added tests for histogram construction