Fix a bug in polyfns; better exception messages