Make rehashing work properly