Fixes deleting and deleting from index, but uses a hack where the uids are copied.