Fix owned sdb_set_internal
Minor code cleanup