Updated HistoStats to make compenstation measurement and added tests for...

Please test, merge and close this branch.

David