                        WHERE structure @> ?::jsonb
                          AND active=true
                          AND language=?"
-                       [(json/write-str spec) language]]
+                       [json-spec language]]
                       :results)))]
-    (log/debug (str "current-count for spec: " spec "=" current-count))
+    (log/info (str "current-count for json-spec: " json-spec "=" current-count))
     (let [count (- count current-count)]
       (if (> current-count 0)
         (log/debug (str "There are already " current-count " expressions for: " spec)))

                          AND language=?")
                       [(json/write-str spec) target-language]]
                      :results)))]
    (log/debug (str "current-target-count for spec: " spec "=" current-target-count))
    (let [count (- count current-target-count)]
      (if (> current-target-count 0)
        (log/debug (str "There are already " current-target-count " expressions for: " spec)))

    [clojure.string :as string]
    [clojure.tools.logging :as log]
    [clojure.tools.namespace.repl :refer [refresh refresh-all]]
    [dag_unify.core :refer [fail? get-in merge remove-top-values strip-refs serialize unify ref?]]
    [korma.core :refer [exec-raw]]))

;; TODO: more fine-grained approach to dealing with exceptions:
