Fix sdb_ns_path() for NULL and empty paths