               (assert (= lower (aget keys 0)) (pr-str lower keys))
               (assert (= upper (aget keys (- (alength keys) 1)))))
             (do
-              (assert (= lower (.-lower (aget children 0))))
-              (assert (= upper (.-upper (aget children (- (alength children) 1)))))
+              (assert (= lower (.-lower (aget children 0))) (pr-str lower (.-lower (aget children 0))))
+              (assert (= upper (.-upper (aget children (- (alength children) 1)))) (pr-str upper (.-upper (aget children (- (alength children) 1)))))
               (assert (every? #(> (aget keys %) (.-upper (aget children %))) (range (count keys))))
               (assert (every? #(< (aget keys %) (.-lower (aget children (inc %)))) (range (count keys))))
-              (dotimes [i (count children)] (.valid! (aget children i)))))))
+              (dotimes [i (count children)] (.valid! (aget children i) min-keys max-keys))))))
 
 (deftype Iterator [max-keys ^:mutable node ^:mutable ix ^:mutable end?]
   Object

                        (aget keys child-i))]
            (when (or (== nil upper) (>= upper from))
              (if (contained? lower upper from to)
                (.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)))

(defn contained? [from to container-from container-to]
  (and (not (or (nil? from)
                (nil? to)))
       (<= container-from from)
       (>= container-to to)))

(defn down-until-contained [node nfrom nto from to result]
