Fixed problem with computation of coefficients