Minor fixes and polyfills