Fix syntax error handling