     deletedNode = @activeNode
     @stateLogger.deleteNode(deletedNode, @activeTree.treeId)
 
-    if deletedNode.type == TYPE_BRANCH
-      @deleteBranch(deletedNode.id)
+    @deleteBranch(deletedNode.id)
     
     if deletedNode.neighbors.length > 1
       # Need to split tree

    @trees.splice(index, 1)
    # remove comments of all nodes inside that tree
    for node in tree.nodes
      @deleteComment(node.id)
      if deleteBranches and node.type == TYPE_BRANCH
        @deleteBranch(node.id)
    # Because we always want an active tree, check if we need
    # to create one.
    if @trees.length == 0

      @deleteTree(false)


  deleteTree : (notify, id, deleteBranchesAndComments) ->

    unless @activeNode?
      return

    if notify
      if confirm("Do you really want to delete the whole tree?")
        @reallyDeleteTree(id, deleteBranchesAndComments)
      else
        return
    else
      @reallyDeleteTree(id, deleteBranchesAndComments)


  reallyDeleteTree : (id, deleteBranchesAndComments = true) ->

    unless id
      id = @activeTree.treeId
