Various fixes for incomplete ECMAScript 5 implementations