Fixed init value of string fields in virtual corpora

Change-Id: I7d9bd8f3a2d440cc6ef9a07f88d1058b65793f63
diff --git a/dev/js/src/vc/doc.js b/dev/js/src/vc/doc.js
index bdedb70..d2a413e 100644
--- a/dev/js/src/vc/doc.js
+++ b/dev/js/src/vc/doc.js
@@ -213,7 +213,6 @@
           // Check the VC list if the field is known
           var type = KorAP._vcKeyMenu.typeOf(this.key());
           if (type != undefined) {
-            console.log("Guessed the type for " + this.key() + " to be " + type);
             json["type"] = "type:" + type;
           };
         };
@@ -476,7 +475,7 @@
     _changeValue : function (e) {
       var v = this.value();
       var that = this;
-
+     
       // Show datepicker
       if (this.type() === 'date') {
         var dp = KorAP._vcDatePicker;
diff --git a/dev/js/src/vc/stringval.js b/dev/js/src/vc/stringval.js
index bd3a65c..10daaee 100644
--- a/dev/js/src/vc/stringval.js
+++ b/dev/js/src/vc/stringval.js
@@ -13,7 +13,8 @@
       regex = arguments[1];
     };
     if (arguments.length >= 1) {
-      value = arguments[0];
+      if (arguments[0] !== undefined)
+        value = arguments[0];
     };
     return Object.create(this)._init(value, regex);
   },
@@ -119,8 +120,10 @@
     
     // Add input field
     this._input = e.addE('input');
-    if (this.value() !== undefined)
+
+    if (this.value() !== undefined) {
       this._input.value = this.value();
+    };
 
     // Add regex button
     var re = e.addE('div');
@@ -138,7 +141,7 @@
     // delegate focus to
     this._input.addEventListener(
       'blur',
-      function (ev) {
+      function (ev) {        
         if (!this._inField) {
 	        this.value(this._input.value);
           this.store(this.value(), this.regex());