             property: dataSource,
             to: #selector(NSOutlineViewDataSource.outlineView(_:numberOfChildrenOfItem:)),
             map: { (dataSource: Element.UnderlyingCollection?, _: NSOutlineView, item: Element.UnderlyingCollection?) -> Int in
-                guard let dataSource = dataSource else { return 0 }
-                return item?.children.count ?? dataSource.count
+                return item?.children.count ?? (dataSource != nil ? 1 : 0)
             }
         )
 

    public var insertAnimation: NSOutlineView.AnimationOptions? = [.effectFade, .slideUp]
    public var deleteAnimation: NSOutlineView.AnimationOptions? = [.effectFade, .slideUp]

    let isItemExpandable: ((TreeNode, TreeNode.Value?, NSOutlineView) -> Bool)?
    let measureCell: ((TreeNode, TreeNode.Value?, NSOutlineView) -> CGFloat?)?
    let createCell: ((TreeNode, TreeNode.Value?, NSTableColumn?, NSOutlineView) -> NSView?)?

    public init() {
        // This initializer allows subclassing without having to declare default initializer in subclass.


public extension SignalProtocol where Element: ObservableCollectionEventProtocol, Element.UnderlyingCollection: TreeNodeProtocol, Error == NoError {
    @discardableResult
    public func bind(to outlineView: NSOutlineView, animated: Bool = true, createCell: @escaping (_ root: Element.UnderlyingCollection, _ node: Element.UnderlyingCollection?, _ column: NSTableColumn?, _ outlineView: NSOutlineView) -> NSView?) -> Disposable {
        let binder = OutlineViewBinder(measureCell: nil, createCell: createCell)
        if !animated {
            binder.deleteAnimation = nil
