fixed bug in nonzeroMean by using retol rather than tol