Fixed typos in sql statements