                       (set! ix (.-parent-ix node))
                       (set! node (.-parent node))
                       (recur))
-                    (set! end? true))
-                  nil)))
+                    (do
+                      (set! end? true)
+                      false))
+                  true)))
             (do
               (set! node (aget (.-children node) (+ ix 1)))
               (set! ix 0)
               (loop []
-                (when-not (nil? (.-children node))
-                  (set! node (aget (.-children node) 0))
-                  (recur)))))))
+                (if (nil? (.-children node))
+                  true
+                  (do
+                    (set! node (aget (.-children node) 0))
+                    (recur))))))))
   (seek [this key]
         (set! old-node node)
         (set! old-ix ix)
         (set! old-end? end?)
         (let [start-node node
               start-ix ix]
-          (when (false? end?)
+          (if (true? end?)
+            false
             (loop []
               (if (key-lt (.-upper node) key)
                 (if (instance? Node (.-parent node))

                      (set! node (aget (.-children node) ix))
                      (set! ix 0)
                      (recur))
                    (if (or (and (identical? node start-node) (== ix start-ix))
                            (key= key (aget (.-keys node) ix))
                            (nil? (.-children node))
                            (key-lt (.-upper (aget (.-children node) ix)) key))
                      nil
                      (do
                        (set! node (aget (.-children node) ix))
                        (set! ix 0)
                        (recur))))))))))
  (undo [this]
        (set! node old-node)
        (set! ix old-ix)

                    (set! ix (.-parent-ix node))
                    (set! node (.-parent node))
                    (recur))
                  (do
                    (set! end? true)
                    false))
                (loop []
                  (set! ix (.seek node key ix))
                  (if (>= ix (alength (.-keys node)))
