A bit more logic simplification in SQLDatabaseManager, also fixes error printing,  Fix #2188