     
     /// Displays the last items title in the button's cell.
     func updateCellWithSelectedItems(items: Array<NSMenuItem>) {
-        if let cell = self.cell() as? NSPopUpButtonCell {
+        if let cell = self.cell as? NSPopUpButtonCell {
             // Don't use item from menu
             cell.usesItemFromMenu = false
             

            selectItemsAtIndexPaths(node.indexPath)
            if let treeController = self.observedSelectionObject as? NSTreeController {
                if treeController.setSelectionIndexPath(node.indexPath) == false {
                    println("Could not select index path \(node.indexPath)")
                }
            }
        } else {

    /// This methods returns nil when nodes is empty.
    ///
    /// :returns: A menu for nodes.
	private class func menuForNodes(nodes: Array<NSTreeNode>, showsStateColumn: Bool, action: Selector, target: AnyObject) -> NSMenu? {
        if nodes.count == 0 {
            return nil
        }
        
        let menu = NSMenu()
		menu.showsStateColumn = showsStateColumn;
		
        for node in nodes {
            if let object = node.representedObject as? NSObject {
                let item = NSMenuItem(title: object.description, action: action, keyEquivalent: "")
                item.target = target
                item.representedObject = node				
                if let childNodes = node.childNodes {
					if let subMenu = menuForNodes(childNodes, showsStateColumn: menu.showsStateColumn, action:action, target: target) {
                        item.submenu = subMenu
                    }
                }
