         static var SelectionIndex = "SelectionIndex"
         static var Content = "Content"
     }
-    
-    override func bind(binding: String, toObject observable: AnyObject, withKeyPath keyPath: String, options: [NSObject : AnyObject]?) {
-        switch binding {
-        case NSContentBinding:
-            observedContentObject = observable
-            observedContentKeyPath = keyPath
-            observable.addObserver(self, forKeyPath: keyPath, options: NSKeyValueObservingOptions.Initial, context: &Context.Content)
-        case NSSelectedIndexBinding:
-            observedSelectionObject = observable
-            observedSelectionKeyPath = keyPath
-            observable.addObserver(self, forKeyPath: keyPath, options: NSKeyValueObservingOptions.Initial, context: &Context.SelectionIndex)
-            break
-        default:
-            super.bind(binding, toObject: observable, withKeyPath: keyPath, options: options)
-        }
-    }
-    
-    override func observeValueForKeyPath(keyPath: String, ofObject object: AnyObject, change: [NSObject : AnyObject], context: UnsafeMutablePointer<Void>) {
-        switch context {
-        case &Context.Content:
-            if let nodes = object.valueForKeyPath("\(observedContentKeyPath!).childNodes") as? [NSTreeNode] {
-                // This replaces the whole menu instance and clears all selected items from the UI
-                // But the selection index will be updated by the tree controller automatically
-                self.menu = NSMenu.menuForNodes(nodes, action:"onMenuItemSelected:", target: self)
-            }
-        case &Context.SelectionIndex:
-            if let indexPath = object.valueForKeyPath(observedSelectionKeyPath!) as? NSIndexPath {
-                menu?.deselectAllItems()
-                selectItemsAtIndexPaths(indexPath)
-            }
-        default:
-            break
-        }
-    }
+	
+	override func bind(binding: String, toObject observable: AnyObject, withKeyPath keyPath: String, options: [String : AnyObject]?) {
+		switch binding {
+		case NSContentBinding:
+			observedContentObject = observable
+			observedContentKeyPath = keyPath
+			observable.addObserver(self, forKeyPath: keyPath, options: NSKeyValueObservingOptions.Initial, context: &Context.Content)
+		case NSSelectedIndexBinding:
+			observedSelectionObject = observable
+			observedSelectionKeyPath = keyPath
+			observable.addObserver(self, forKeyPath: keyPath, options: NSKeyValueObservingOptions.Initial, context: &Context.SelectionIndex)
+			break
+		default:
+			super.bind(binding, toObject: observable, withKeyPath: keyPath, options: options)
+		}
+	}
+	
+	override func observeValueForKeyPath(keyPath: String?, ofObject object: AnyObject?, change: [String : AnyObject]?, context: UnsafeMutablePointer<Void>) {
+		switch context {
+		case &Context.Content:
+			if let nodes = object!.valueForKeyPath("\(observedContentKeyPath!).childNodes") as? [NSTreeNode] {
+				// This replaces the whole menu instance and clears all selected items from the UI
+				// But the selection index will be updated by the tree controller automatically
+				var showsStateColumn = true;
+				if let currentMenu = self.menu {
+					showsStateColumn = currentMenu.showsStateColumn;
+				}
+				self.menu = NSMenu.menuForNodes(nodes, showsStateColumn: showsStateColumn, action:"onMenuItemSelected:", target: self)
+			}
+		case &Context.SelectionIndex:
+			if let indexPath = object!.valueForKeyPath(observedSelectionKeyPath!) as? NSIndexPath {
+				menu?.deselectAllItems()
+				selectItemsAtIndexPaths(indexPath)
+			}
+			else
+			{
+				self.selectItem(nil);
+			}
+		default:
+			break
+		}
+	}
     
     /// Called from a menu item when selected from the user.
     func onMenuItemSelected(sender: NSMenuItem) {

    /// This methods returns nil when nodes is empty.
    ///
    /// :returns: A menu for nodes.
    private class func menuForNodes(nodes: NSArray, action: Selector, target: AnyObject) -> NSMenu? {
        if nodes.count == 0 {
            return nil
        }
        
        let menu = NSMenu()
        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 as? Array<NSTreeNode> {
                    if let subMenu = menuForNodes(childNodes, action:action, target: target) {
                        item.submenu = subMenu
                    }
                }

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