Tweaks for set logic and ancestry logging. Set now creates new copies of all elements passed in to prevent shared memory.