Simplify indexOf tests

Minor code style fix