Fix a problem with syntax checking and limit clauses