Fix incorrect pattern-matching