           (aset new-arr idx key)
           (aset new-arr (inc idx) val)
           (array-copy arr idx new-arr (+ 2 idx) (- n idx))
-          (set! (.-added changed?) true)
-          (set! (.-modified changed?) true)
+          (set! (.-val added-leaf?) true)
           (BitmapIndexedNode. aedit (bit-or datamap bit) nodemap new-arr)))))
 
   (has-nodes? [_]

    (if edit
      (if (nil? root)
        tcoll
        (let [removed-leaf? (Box. false false)
              node (.inode-without root edit 0 (hash k) k removed-leaf?)]
          (if (identical? node root)
            nil
            (set! root node))
          (if ^boolean (.-modified removed-leaf?)
            (set! count (dec count)))
          tcoll))
      (throw (js/Error. "dissoc! after persistent!"))))


  (assoc! [tcoll k v]
    (if edit
      (let [added-leaf? (Box. false)
            node (.inode-assoc root edit 0 (hash k) k v added-leaf?)]
        (if (identical? node root)
          nil
          (set! root node))
        (if ^boolean (.-val added-leaf?)
          (set! count (inc count)))
        tcoll)
      (throw (js/Error. "assoc! after persistent!"))))
