       (when-not (nil? value)
         (protocols/put! c value (fn-handler active? (fn [] nil))))
       (protocols/close! c))
-    (ago-dereg-state-machine ago-world (.-buf-id (.-buf c)))
+    (ago-dereg-state-machine ago-world (.-buf-id c))
     c))
 
 ; --------------------------------------------------------


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

(defn ago-chan-buf [ago-world buf & default-buf-id]
  (let [buf-id (if buf
                 (.-buf-id buf)
                 (or (first default-buf-id) "unknown"))]
    (channels/ManyToManyChannel.
     (fifo-buffer ago-world (:seqv @ago-world) (str buf-id "-takes") -1) 0
     (fifo-buffer ago-world (:seqv @ago-world) (str buf-id "-puts") -1) 0
     buf false)))

(defn ago-chan
  "Creates a channel with an optional buffer. If buf-or-n is a

                     ch-id))))

(defn chan-seqv [ch]
  (when (instance? WrapManyToManyChannel ch)
    (.-seqv ch)))

(defn chan-ago-world [ch]
  (when (instance? WrapManyToManyChannel ch)
    (.-ago-world ch)))

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

