Fixed a problem that caused the PatternExtractor to add invalid patterns.