Corrected other SQL errors
Merge pull request #299 from Lerogero/master

Corrected other SQL errors