               (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

(defn collect [tree from to]
  (let [itr (iterator tree)
        coll (array (-> (.seek itr from)
                        second))]
    (loop [cur (.next itr)]
      (when (and cur (<= (first cur) to))
        (.push coll (second cur))
        (recur (.next itr))
        ))
    coll))

     (dotimes [i 10000]
       (.assoc! tree i (* 2 i)))
     (perf-time
      (dotimes [x 10000]
        (collect tree 5000 9020)))
     )

   (let [tree (tree 10 +)]
     (dotimes [i 10000]
       (.assoc! tree i (* 2 i)))
      (aggregate-range tree 5000 9020)
     (perf-time
      (dotimes [x 10000]
        (aggregate-range tree 5000 9020))))

  )
