restored pattern-matcher functionality