                         (aget keys child-i))]
             (when (or (== nil upper) (>= upper from))
               (if (contained? lower upper from to)
-                (.push result (.getAggregate child))
+                (do
+                  (.push result (.getAggregate child)))
                 (when (<= lower to)
                   ;;check if this node's value needs to go in
                   (down-until-contained child lower upper from to result)))

                      (when (>= len 0)
                        (set! (.-aggregate this) (aggregateFunc (.-aggregate this) (.getAggregate (aget children len))))
                        (recur (dec len)))))
                  (set! (.-dirty? this) false))
                (.-aggregate this))
  (seek [this key ix]
        (loop [lo (max ix 0)

                (set! (.-lower right-node) (.-lower (aget children (+ median 1))))))
            (set! (.-keys right-node) (.slice keys (+ median 1)))
            (set! (.-vals right-node) (.slice vals (+ median 1)))
            (.splice keys median (alength keys))
            (.splice vals median (alength vals))
            (when-not (nil? children)
              (let [right-children (.slice children (+ median 1))]
                (dotimes [ix (alength right-children)]
                  (let [child (aget right-children ix)]
                    (set! (.-parent child) right-node)
                    (set! (.-parent-ix child) ix)))
                (set! (.-children right-node) right-children)
                (.splice children (+ median 1) (alength children))))
            #_(.valid! this (js/Math.floor (/ max-keys 2)) max-keys)
            #_(.valid! right-node (js/Math.floor (/ max-keys 2)) max-keys)
            (.insert! parent parent-ix median-key median-val right-node max-keys)))
  (valid! [this min-keys max-keys]
          (when (instance? Node parent) ;; root is allowed to have less keys
            (assert (>= (count keys) min-keys) (pr-str keys min-keys)))
          (assert (<= (count keys) max-keys) (pr-str keys max-keys))
          (assert (= (count keys)) (inc (count children)))
          (assert (= (count keys) (count (set keys))))
          (assert (= (seq keys) (sort keys)))
          (assert (every? #(<= lower %) keys))
