Fixed error in main script when using other database engine. Fixed #1166.
Merge pull request #1167 from normanjaeckel/MainError

Fixed error in main script when using other database engine. Fixed #1166.
Merge branch 'stable/1.5.x'