corrects bug in statistics
corrects model generation .m files