Fixed some problems with StatisticModel