SQL generator after first test (bug fix)