Fix missing pattern matching and reorder the existing one.