fixes to allow arbitrary polynomial orders and missing coefficients