Fix punctuation match order and add tests