Made CompilingPatternMatching testable.
Fixed infinite loop bug in CompilingPatternMatching.