Compatibility fixes to keep setup code from crashing in older browsers.