Fixed code involving errors on the data and coefficients.