          (.reset iterator)))
 
 (defn trieterator [iterator]
-  (let [trieterator (Trieterator. iterator (greatest-key (.-key-len iterator)) nil -1 0 false (.-key-len iterator))]
+  (let [trieterator (Trieterator. iterator (greatest-key (.-key-len iterator)) (greatest-key (.-key-len iterator)) 0 false (.-key-len iterator))]
     (.maintain trieterator)
     trieterator))
 

         (.val iterator)))
  (maintain [this]
            (if (or (true? (.-end? iterator))
                    (not (or (< pinned-key-ix 0) ;; nothing to pin
                             (identical? pinned-key (aget (.key iterator) pinned-key-ix)))))
              (set! end? true)
              (do
                (set! end? false)
                (aset seek-key moving-key-ix (.key this)))))
  (next [this]
        (when (false? end?)
          (.seek iterator seek-key)

                 movements (gen/vector (gen-next key-len))] ;; TODO use gen-movement once Treeterator supports seek
                (run-self-join-prop min-keys key-len actions movements)))

(comment
  (dc/quick-check 1000 (least-prop 1))
  (dc/quick-check 1000 (least-prop 2))
