Not quite as drop in as I was expecting ... fixing a bug the indexOf replacement introduced.