                (.copy-and-remove-value inode wedit bit)))
             inode))
         (not (zero? (bit-and nodemap bit)))
-        (let [sub-node (aget arr (node-at arr nodemap bit))
+        (let [sub-node (aget arr (.node-at inode bit))
               sub-node-new (.inode-without sub-node wedit (+ shift 5) hash key removed-leaf?)]
           (if (identical? sub-node sub-node-new)
             inode

            [k (aget arr (inc (* 2 idx)))]
            not-found))
        (not (zero? (bit-and nodemap bit)))
        (.inode-lookup (node-at arr nodemap bit) (+ shift 5) hash key not-found)
        :else
        not-found)))


              (set! (.-val added-leaf?) true)
              (.copy-and-migrate-to-node inode aedit bit new-node))))
        (not (zero? (bit-and nodemap bit)))
        (let [sub-node (aget arr (.node-at inode bit))
              sub-node-new (.inode-assoc sub-node aedit (+ shift 5) hash key val added-leaf?)]
          (if (identical? sub-node sub-node-new)
            inode
