     ; Using kvs-mgr-state to avoid atoms, which prevent time-travel.
     (act-loop kvs-mgr-state actx [state { :next-uuid 0 :kvss {} }]
               (if-let [[state-fn done-ch] (atake kvs-mgr-state state-ch)]
-                (if-let [[next-state done-res] (state-fn state)]
-                  (do (when (and done-ch done-res)
-                        (aput-close kvs-mgr-state done-ch done-res))
-                      (recur next-state))
-                  (println :kvs-mgr-state-fn-exit))
+                (let [[next-state done-res] (state-fn state)]
+                  (when (and done-ch done-res)
+                    (aput-close kvs-mgr-state done-ch done-res))
+                  (recur (or next-state state)))
                 (println :kvs-mgr-state-ch-exit)))
     cmd-ch))

                                                   (assoc :dirty (make-kc))))
                                     {:status :ok :status-info :synced}]))))})

(defn make-kvs-mgr [actx]
  (let [cmd-ch (achan actx)
        state-ch (achan actx)]
    (act-loop kvs-mgr-in actx [tot-ops 0]
              (if-let [m (atake kvs-mgr-in cmd-ch)]
                (if-let [op-handler (get op-handlers (:op m))]
                  (do (op-handler kvs-mgr-in state-ch m)
                      (recur (inc tot-ops)))
                  (println :kvs-mgr-in-unknown-op-exit m))

               [(kvs-ident-check (:kvs-ident m) work-fn) nil]))))

   :scan-keys
   (make-scan-fn :keys :key kc-entry-by-key-sq)

   :scan-changes
   (make-scan-fn :changes :sq (fn [kc sq-key entry] entry))

   :sync
   (fn [actx state-ch m]
