Fixes to polynomial handling.