Fixed a bug in saving the coeffs and models when we hit an error.