 
     element = event.target
     while element.tagName != 'LI' or (! element.classList.contains('item') and ! element.classList.contains('group'))
-      return selectionChanged if element == @_treeRoot
+      return selectionChanged if element == @treeRoot
       element = element.parentElement
 
     if @selectedNodes.length > 0 and @selectedNodes[0].parentElement != element.parentElement

    if element.tagName == 'OL' and element.classList.contains 'children'
      element = element.parentElement

    if element == @_treeRoot
      element = element.lastChild
      element = element.previousSibling if element.tagName == 'OL'
      return { target: element, where: 'below' }

    while element.tagName != 'LI' or (! element.classList.contains('item') and ! element.classList.contains('group'))
      return null if element == @_treeRoot
      element = element.parentElement

    where = @_getInsertionPoint element, event.pageY

      throw new Error 'Invalid parent group' if parentGroupElement.tagName != 'LI' or ! parentGroupElement.classList.contains 'group'
      parentGroupElement = parentGroupElement.nextSibling
    else
      parentGroupElement = @treeRoot

    element.classList.add type
    element.draggable = true
