Fixed some snazzle frazzle with the SQL