Avoid Array.indexOf which is unavailable in IE8
3.5.1