diff --git a/dev/js/spec/vcSpec.js b/dev/js/spec/vcSpec.js
index 24b24a7..4f7c7dc 100644
--- a/dev/js/spec/vcSpec.js
+++ b/dev/js/spec/vcSpec.js
@@ -156,13 +156,13 @@
 
       // No valid string
       doc = stringFactory.create({
-	value : { "foo" : "bar" }
+	      value : { "foo" : "bar" }
       });
       expect(doc).toBeUndefined();
 
       // Change match type
       doc = stringFactory.create({
-	"match" : "match:ne"
+	      "match" : "match:ne"
       });
 
       expect(doc.matchop()).toEqual('ne');
@@ -172,7 +172,7 @@
 
       // Invalid match type
       doc = stringFactory.create({
-	"match" : { "foo" : "bar" }
+	      "match" : { "foo" : "bar" }
       });
       expect(doc).toBeUndefined();
     });
@@ -186,19 +186,21 @@
 
       // change matcher
       doc = regexFactory.create({
-	match : "match:ne"
+	      match : "match:ne"
       });
       expect(doc.matchop()).toEqual('ne');
+      expect(doc.rewrites()).toBeUndefined();
 
       // Invalid matcher
       doc = regexFactory.create({
-	match : "match:chook"
+	      match : "match:chook"
       });
-      expect(doc).toBeUndefined();
+      expect(doc.matchop()).toEqual('eq');
+      expect(doc.rewrites()).toBeDefined();
 
       // Invalid regex
       doc = regexFactory.create({
-	value : "[^b"
+	      value : "[^b"
       });
       expect(doc).toBeUndefined();
     });
@@ -215,7 +217,7 @@
 
       // Short date 1
       doc = dateFactory.create({
-	"value" : "2014-11"
+	      "value" : "2014-11"
       });
 
       expect(doc.matchop()).toEqual('eq');
@@ -225,7 +227,7 @@
 
       // Short date 2
       doc = dateFactory.create({
-	"value" : "2014"
+	      "value" : "2014"
       });
 
       expect(doc.matchop()).toEqual('eq');
@@ -235,15 +237,17 @@
 
       // Invalid date!
       doc = dateFactory.create({
-	"value" : "2014-11-050"
+	      "value" : "2014-11-050"
       });
       expect(doc).toBeUndefined();
 
       // Invalid matcher!
       doc = dateFactory.create({
-	"match" : "match:ne",
+	      "match" : "match:ne",
       });
-      expect(doc).toBeUndefined();
+      expect(doc).toBeDefined();
+      expect(doc.rewrites()).toBeDefined();
+      expect(doc.matchop()).toEqual('eq');
     });
 
     it('should be serializale to JSON', function () {
@@ -285,11 +289,11 @@
 
       doc = dateFactory.create();
       expect(doc.toJson()).toEqual(jasmine.objectContaining({
-	"@type" : "koral:doc",
-	"type" : "type:date",
-	"value" : "2014-11-05",
-	"match" : "match:eq",
-	"key" : 'pubDate'
+	      "@type" : "koral:doc",
+	      "type" : "type:date",
+	      "value" : "2014-11-05",
+	      "match" : "match:eq",
+	      "key" : 'pubDate'
       }));
 
       doc = dateFactory.create({
diff --git a/dev/js/src/vc/doc.js b/dev/js/src/vc/doc.js
index 6a44fa8..67bf37a 100644
--- a/dev/js/src/vc/doc.js
+++ b/dev/js/src/vc/doc.js
@@ -195,6 +195,8 @@
         return;
       };
 
+      var rewrite;
+
       // There is a defined key
       if (json["key"] !== undefined &&
           typeof json["key"] === 'string') {
@@ -221,7 +223,10 @@
           // Check match type
           if (!KorAP._validStringMatchRE.test(this.matchop())) {
             KorAP.log(802, "Match type is not supported by value type");
-            return;
+
+            // Rewrite method
+            this.matchop('eq');
+            rewrite = 'modification';
           };
 
           // Set string value
@@ -237,7 +242,10 @@
 
             if (!KorAP._validDateMatchRE.test(this.matchop())) {
               KorAP.log(802, "Match type is not supported by value type");
-              return;
+
+              // Rewrite method
+              this.matchop('eq');
+              rewrite = 'modification';
             };
 
             // Set value
@@ -260,7 +268,10 @@
 
             if (!_validRegexMatchRE.test(this.matchop())) {
               KorAP.log(802, "Match type is not supported by value type");
-              return;
+
+              // Rewrite method
+              this.matchop('eq');
+              rewrite = 'modification';
             };
 
             this.value(json["value"]);
@@ -279,10 +290,16 @@
         };
       };
 
+      // Rewrite coming from the server
       if (json["rewrites"] !== undefined) {
-        this._rewrites = rewriteListClass.create(json["rewrites"]);
+        this.rewrite(json["rewrites"]);
+      }
+
+      // Rewrite coming from Kalamar
+      else if (rewrite !== undefined) {
+        this.rewrite(rewrite);
       };
-      
+
       return this;
     },
 
@@ -494,21 +511,29 @@
       return this._rewrites;
     },
 
+    rewrite : function (value) {
+      if (typeof value === 'string') {
+        value = [{
+          "@type" : "koral:rewrite",
+          "operation" : "operation:" + value,
+          "src" : "Kalamar"
+        }];
+      };
+      this._rewrites = rewriteListClass.create(value);
+    },
+
+    // Remove rewrite marker when the data changes
     _changed : function () {
       this.__changed = true;
-      
-      /*
-        if (this._parent) {
-        };
-      */
 
       if (this._rewrites === undefined)
         return;
 
-      delete this["_rewrites"];
+        delete this["_rewrites"];
 
       if (this._element === undefined)
         return;
+
       this._element.classList.remove("rewritten");
     },
 
