SQL Fix after 933381f

Everything is self explaining I guess.