Fixes infinite loop in the statistical estimators.