Replaces .some() with .indexOf() where appropriate
Merge pull request #823 from spadgos/more-efficient-searching

Replaces .some() with .indexOf() where appropriate (fixed #825)