Fix SQL syntax (mine is awful lately)