Fixes for hdb_destroy