Fixing string indexing on IE