   (vec (map (fn [m] {:metric m}) metrics)))
 
 (deftest combine-test
-         (let [r (ref nil)
+         (let [r (atom nil)
                sum (combine folds/sum (register r))
                min (combine folds/minimum (register r))
                max (combine folds/maximum (register r))

                  (vec (map (fn [s] (:state s)) (deref output)))))

           ; Test with init
           (dosync (ref-set output []))
           (doseq [state states]
             (r2 {:state state}))
           
           (is (= [:bad :ok :evil :bad]
                  (vec (map (fn [s] (:state s)) (deref output)))))))
           
(deftest changed-state-test
         ; Each test stream keeps track of the first host/service it sees, and
         ; confirms that each subsequent event matches that host, and that

                           [{:tags ["foo" "bar"]} {:tags ["foo" "bar" "baz"]}]))))

         (testing "tagged-any (multiple tags)"
                  (let [r (atom [])
                        s (where (tagged-any ["foo" "bar"]) (append r))
                        events [{}
                                {:tags []}
