Fixing invalid initialization of new QSqlDatabase.
Improved logging.