                     (restart-agent a @a))))
             
             ;; Enqueue the votes on the agent for that conversation.            
-            (send a (make-math-updater zid))
+            (send a (make-math-updater votes))
             
             
             (println "zid: " zid)


(def conversations (atom {})) ; Will contain zid -> agent(data)

(def pending-votes (ref {})) ; zid -> [votes]

(defn make-math-updater [zid]
  (fn [conv]
    (let [votes (dosync
                 (let [votes ((deref pending-votes) zid)]
                   (ref-set pending-votes (dissoc (deref pending-votes) zid))
                   votes))]
      (if (empty? votes)
        conv ; No new votes to process, return conv as-is
        (let [start (System/currentTimeMillis)
              conv2 (conv-update conv votes)
              end (System/currentTimeMillis)
              duration (- end start)]
          (metric "math.pca.compute.ok" duration)
          (println conv2)
          
          (if (> (:lastVoteTimestamp conv2) (:lastVoteTimestamp conv)) ; basic sanity check. else don't modify.
            conv2
            conv))))))

(defn bid-to-pid-uploader [key iref old_conv conv]
  (println "bid-to-pid-uploader " (:zid conv))

                      (init-conv-agent zid))
                ]

            ;; Clear old errors.
            (let [old-error  (agent-error a)]
              (if (not (nil? old-error))
