Fix exception pattern matching for internal unicode strings