diff --git a/esprima-to-ast.js b/esprima-to-ast.js
index 1a2cafc542e0706fc4b74de5c3a4771e6ab4c795..210e7a47d0749dcce2148580141b5394bac9cc8a 100644
--- a/esprima-to-ast.js
+++ b/esprima-to-ast.js
@@ -18,8 +18,6 @@ function esprimaToAST(prog) {
             stop:  {line: pos.end.line, col: pos.end.column}};
   };
 
-  var id = function (i) { return i; }
-
   var toOption = function (funcTr, node) {
     var option = { type: "option" };
     if (node === null) {
@@ -48,7 +46,7 @@ function esprimaToAST(prog) {
       option.tag = "Coq_label_empty";
     } else {
       option.tag = "Coq_label_string";
-      option.value = label;
+      option.value = trIdentifier(label);
     }
     return option;
   };
@@ -223,7 +221,7 @@ function esprimaToAST(prog) {
       r.else_branch = toOption(trStat, stat.alternate);
     } else if (stat.type === "LabeledStatement") {
       r.tag = "Coq_stat_label";
-      r.label = stat.label;
+      r.label = trIdentifier(stat.label);
       r.stat = trStat(stat.body);
     } else if (stat.type === "BreakStatement") {
       r.tag = "Coq_stat_break";
@@ -355,7 +353,7 @@ function esprimaToAST(prog) {
     } else if (expr.type === "FunctionExpression") {
       checkFuncExpr(expr);
       r.tag = "Coq_expr_function";
-      r.func_name_opt = toOption(id, expr.id);
+      r.func_name_opt = toOption(trIdentifier, expr.id);
       r.arg_names = toList(expr.params.map(trPattern));
       r.body = trBlockStatAsFuncbody(expr.body);
       // TODO: USE STRICT