Fix pattern matching and use a runtime trap for the default case
Add a working example for pattern matching