Fix sql now that I actually tested it..