Fix pattern matching not exhaustive