   (lookupInMap binding, name) or 'unbound name #{name}'
 
 freshInstance = (ctx, type) ->
-  throw "not a forall in freshInstance" unless type instanceof ForAll
+  throw new Error "not a forall in freshInstance" unless type instanceof ForAll
   freshes = map ((kind) -> ctx.freshTypeVariable kind), type.kinds
   (substitute freshes, type).type
 
 freshName = (nameIndex) ->
-  suffix = if nameIndex > 25 then Math.floor nameIndex / 25 else ''
-  String.fromCharCode 97 + nameIndex % 25
+  suffix = if nameIndex > 25 then freshName (Math.floor nameIndex / 25) - 1 else ''
+  (String.fromCharCode 97 + nameIndex % 25) + suffix
 
 # Kind (data
 #   Star

  };
};

var $sequenceSize = function (xs) {
  if (typeof xs === "undefined" || xs === null) {
    throw new Error('Pattern matching on size of undefined');
  }
  if (xs.length !== null) {
    return xs.length;
  }
  return 1 + $sequenceSize(xs.tail);
};

var $sequenceAt = function (i, xs) {
  if (typeof xs === "undefined" || xs === null) {
    throw new Error('Pattern matching required sequence got undefined');
  }

        .map(validIdentifier)
      paramList = paramNames.join(', ')
      paramAssigns = blockOfLines paramNames.map (name) ->
        "  this.#{name} = #{name};"
      constrFn = """function #{identifier}(#{paramList}) {#{paramAssigns}};"""
      constrValue = if params
        """
