Missing include in log1p
Fix maxnummag by using maxmag instead of minmag
Fix polyval includes