Correctly check for matches.