Use `detect` to pull out array member

Use `detect` to find the appropriate array member that we need to check
against in testing, rather than using a magic number of '2' that has no
semantic value.