small typo fixes and sql statement fixes