Fixes uniqueness for the ScalaPatternMatcher