Added check to ensure user isn't trying to assign a child node to one of its own descendants.