Handle syntax errors gracefully