Fix syntax errors in pattern