Errors corrected in SQL strings