Fix flattening of the coefficients.