fixed typo in quad_coeff computation