Fix some issues with sdb_ns