                        buf-or-n)
                      ch-id))))
 
+(defn chan-ago-world [ch]
+  (when (instance? WrapManyToManyChannel ch)
+    (.-ago-world ch)))
+
 (defn chan-seqv [ch]
   (when (instance? WrapManyToManyChannel ch)
     (.-seqv ch)))
 
-(defn chan-ago-world [ch]
+(defn chan-buf-id [ch]
   (when (instance? WrapManyToManyChannel ch)
-    (.-ago-world ch)))
+    (.-buf-id ch)))
 
 ; --------------------------------------------------------
 
 (defn ago-reg-state-machine [ago-world state-machine-arr buf-id]
-  (swap! ago-world #(seqv+ (assoc-in % [:smas-new buf-id] state-machine-arr))))
+  (swap! ago-world #(-> %
+                        (assoc-in [:smas-new buf-id] state-machine-arr)
+                        (dissoc-in [:smas buf-id])
+                        (seqv+))))
 
 (defn ago-run-state-machine [ago-world state-machine-arr buf-id]
   (swap! ago-world #(-> %

(deftype WrapManyToManyChannel [ago-world seqv buf-id m2m-ch]
  protocols/WritePort
  (put! [this val ^not-native handler]
    (protocols/put! m2m-ch val handler))

  protocols/ReadPort
  (take! [this ^not-native handler]
    (protocols/take! m2m-ch handler))

  protocols/Channel
  (closed? [_]
    (protocols/closed? m2m-ch))
  (close! [this]
    (protocols/close! m2m-ch)))

; --------------------------------------------------------

                  (assoc :bufs (:bufs ss))
                  (assoc :smas recycled-smas)
                  (assoc :smas-new recycled-smasN)
                  (assoc :closed (:closed ss))
                  (assoc :logical-ms (:logical-ms ss))
                  (assoc :physical-ms (now))))
      (doseq [[sma-old ss-buf-id] reborn-smas]
