         locals (if name (assoc locals name {:name mname}) locals)
         menv (if (> (count meths) 1) (assoc env :context :expr) env)
         methods (map #(analyze-fn-method menv locals %) meths)
-        max-fixed-arity (apply max (map :fixed-arity methods))
-        variadic (some :variadic methods)]
+        max-fixed-arity (apply max (map :max-fixed-arity methods))
+        variadic (boolean (some :variadic methods))]
     ;;(assert (= 1 (count methods)) "Arity overloading not yet supported")
     ;;todo - validate unique arities, at most one variadic, variadic takes max required args
     {:env env :op :fn :name mname :methods methods :variadic variadic

      (println (str "goog.exportSymbol('" export "', " name ");")))))

(defn emit-fn-method
  [{:keys [gthis name variadic params statements ret env recurs]}]
  (emit-wrap env
             (print (str "(function " name "(" (comma-sep
                                                (if variadic

        recur-frame {:names (vec (map munge params)) :flag (atom nil)}
        block (binding [*recur-frame* recur-frame]
                (analyze-block (assoc env :context :return :locals locals) body))]
    
    (merge {:env env :variadic variadic :params (map munge params) :max-fixed-arity fixed-arity :gthis gthis :recurs @(:flag recur-frame)} block)))

(defmethod parse 'fn*
  [op env [_ & args] name]
