matcher: fix some inconsistencies in matcher logic.