fix evildmp/Arkestra#68

This one should fix issue #68. I have tested it with sqllite and mysql and it works just as it should.