Fixed errors in statistics generator