                   ;; TODO make this conditional like keyword
                   ;; predicates
                   ;; BEFORE keyword predicates
-                  (when (and (map? val) (> (count val) 0))
+                  (when (and (map? vl) (> (count vl) 0))
                     (for [[k _ [pt _ val-typ]] (schema-rules :-)
                           :when (and
                                  (not= k ky)
                                  (not (similar-key 0 k ky)))
                           parent-type (concrete-parent pt)]
                       (let [child-type-paths (filter #(= (first %) val-typ)
-                                                     (tc-with-parent val-typ val))]
+                                                     (tc-with-parent val-typ vl))]
                         (when (< (good-bad-ratio child-type-paths)
-                                 (if (> (count val) 1)
+                                 (if (> (count vl) 1)
                                    0.5 0.3))
                           (mapcat #(concat [parent-type [:replace-key ky k]] %)
                                   child-type-paths))))))))]
     res
     ;; try keyword predicates expensive
-    (doall
+    (doall 
      (for [[pred-id _ [pt _ val-typ]] (schema-rules :?-)
            parent-type (concrete-parent pt)
            :when (when-let [pred-func (last (first (schema-rules [:= pred-id])))]
                    (pred-func ky)) 
-           child-types (tc-with-parent val-typ val)]
+           child-types (tc-with-parent val-typ vl)]
        (concat [parent-type ky] child-types)))))
 
 #_(pp)

                    (rest (rest path))
                    (rest path)))
                 leaf-node
                 orig-config)]
    :break
    :break
    document
    :line
    ])
  ([error leaf]
   (print-path-error error leaf "")))

(defn gen-path [path value]
  (if (empty? path)
    value
    (let [[x & xs] path]
      (cond
        (and (integer? x) (zero? x))
        [(gen-path xs value)]
        :else {x (gen-path xs value)}))))

#_(gen-path [:cljsbuild :builds 0 :compiler :closure-warnings :const] 5)

(defn print-wrong-path-error
  ([{:keys [path orig-config correction path correct-paths value] :as error} leaf-node document]
   [:group
    "------- Figwheel Configuration Error -------\n"
    :break
    (error-help-message error)
    :break


(declare tc-with-parent)

(defn tc-kv [ky vl]
  (if-let [res (not-empty
                (doall
                 (concat
                  (for [[_ _ [pt _ val-typ]] (schema-rules [:- ky])
                        parent-type (concrete-parent pt)
                        child-types (tc-with-parent val-typ vl)]
                    (concat [parent-type ky] child-types))
                  ;; keys that are mispelled locals
                  (for [[k _ [pt _ val-typ]] (schema-rules :-)
                        :when (and (not= k ky)
                                   (similar-key 0 k ky))
                        parent-type (concrete-parent pt)
                        child-types (tc-with-parent val-typ vl)]
                    (concat [parent-type [:subst ky k]] child-types))
                  ;; keys that have complex children that match
                  ;; this value
