     public mutating func withCursorAtEnd<R>(@noescape body: Cursor throws -> R) rethrows -> R {
         makeUnique()
         let cursor = BTreeCursor(BTreeCursorPath(endOf: root))
-        root = Node()
+        root = Node(order: self.order)
         defer { self.root = cursor.finish() }
         return try body(cursor)
     }

    public mutating func withCursorAt<R>(key: Key, choosing selector: BTreeKeySelector = .Any, @noescape body: Cursor throws -> R) rethrows -> R {
        makeUnique()
        let cursor = BTreeCursor(BTreeCursorPath(root: root, key: key, choosing: selector))
        root = Node()
        defer { self.root = cursor.finish() }
        return try body(cursor)
    }

        index.state.expectRoot(root)
        makeUnique()
        let cursor = BTreeCursor(BTreeCursorPath(root: root, slotsFrom: index.state))
        root = Node(order: self.order)
        defer { self.root = cursor.finish() }
        return try body(cursor)
    }
