Handle invalid syntax gracefully