Remove faulty and unused function.
Fix convertPattern function, code got separated from the match.