Fix bug for simple SQL statements