Fixed bug where the averageHistogram could not be read more than once