Fixed some SQL-Errors

I run in some SQL-Errors, this should fix them
Merge pull request #26 from befrenze/master

Fixed some SQL-Errors