Fix pattern matching bug

Fix a bug for pattern match case: constant on left