Fix non-exhaustive pattern matches