some fixes for histogram