Fixed some SQL-Errors

I run in some SQL-Errors, this should fix them