The tests exposed the issues pretty well

We probably should pull this matching logic out somewhere centrally, it is annoying to change in multiple spots. Ideas?