fix subtype checking in #match