Added polyfill for Array.indexOf()