More quad_form functions.