         if children.indexOf(realModel) < at
           at = at - 1
         children.remove(realModel)
+        realModel._tree_parent = null
 
       # Before adding the model make sure it's a Tree Node (does it have `._children`.
       # If not, wrap it in a node


    newNode: (options) -> throw 'BUG: Only the root can create new Pointer Nodes'

    getParent: () -> @_tree_parent
    getChildren: () -> @_tree_children

    removeChild: (model) ->
      throw 'BUG: child is not in this node' if not @getChildren().get(model.id)
      @getChildren().remove(model.id)

    addChild: (model, at=0) ->
      children = @getChildren()

        #

        # Remove the child if it is already attached somewhere
        child._tree_parent.removeChild(child) if child._tree_parent and child._tree_parent != @

        child._tree_parent = @
        child._tree_root = @_tree_root
