fixed bug in stats.py that would generate positive indefinite covariance matrices,  general debugging