Better debugging for class_database.php