Fix bug that allowed node to be made a chile of its child