Hopefully matlabify is called now
Merge pull request #24 from AlexWalterbos/fix-stats-generation

Call stats generation when stop condition is reached.