Some bugfixes inside class.database.php.