Fix and add test for StatisticProvider