added maxmodnb, fixed polyval_cube for univariate arguments