Amended indexOf() to accept null as first argument