         single-if (= (. conditions size) 1)]
 
     (cond
-      (and single-if else) `(if ~(. conditions (get 0)) ~(. results (get 0)) ~else)
+      (and single-if (not (nil? else))) `(if ~(. conditions (get 0)) ~(. results (get 0)) ~else)
       single-if `(if ~(. conditions (get 0)) ~(. results (get 0)))
       (not else) `(cond ~@(alternate conditions results))
       :else `(cond ~@(alternate conditions results) :else ~else))))

  `(defn
     ~(get-symbol ctx name)
     [~@(self-visit this ctx functionDefParams)]
     ~@(self-visit this ctx block)))


(defn -visitMethodDef
  [this ^JestParser$MethodDefContext ctx]
  (throw (new NotImplementedException)))


(defn -visitFunctionDefParams

      `(doall (map ~func ~@iterator)))))


(defn- wrap-in-do
  [expressions]
  (cond
    (not (instance? List expressions)) expressions
    (= 0 (count expressions)) (throw (new NotImplementedException))
    (= 1 (count expressions)) (first expressions)
    :else `(do ~@expressions)))


(defn -visitBlock
  "A block doesn't return a list, it only returns a single expression.
  However, if there are multiple expressions coming from that block,
  it wraps them in a do expression"
  [this ^JestParser$BlockContext ctx]

  (cond
    (. ctx expression) (self-visit this ctx expression)

    ;;(. ctx term) (into [] (map #(.. this (visitStatementTerm %)) (. ctx term)))

    (. ctx term) (let [num-terms (.. (. ctx term) size)]
                   (cond
                     (= 0 num-terms) (throw (new NotImplementedException))
                     (= 1 num-terms) (.. this (visitStatementTerm (.. (. ctx term) (get 0))))
                     :else `(do ~@(into [] (map #(.. this (visitStatementTerm %)) (. ctx term))))))

    ;;(. ctx scope) (into [] (map #(.. this (visitVarScope %)) (. ctx scope)))

    (. ctx scope) (let [num-scopes (.. (. ctx scope) size)]
                    (cond
                      (= 0 num-scopes) (throw NotImplementedException)
                      (= 1 num-scopes) (.. this (visitVarScope (.. (. ctx scope) (get 0))))
                      :else `(do ~@(into [] (map #(.. this (visitVarScope %)) (. ctx scope))))))

    :else (throw (new ClojureSourceGenerator$BadSource ctx))))


(defn -visitVarScope
