Fixed some errors in initial SQL