Fixing indexOf for browsers lacking support