Fixed exhausted pattern matching.