Fix SQLQueries