diff --git a/public/js/spec/vcSpec.js b/public/js/spec/vcSpec.js
index c532d32..5f7d3ad 100644
--- a/public/js/spec/vcSpec.js
+++ b/public/js/spec/vcSpec.js
@@ -728,6 +728,55 @@
       }
     ]
   });
+
+  var demoFactory = buildFactory(KorAP.VirtualCollection, {
+    "@type":"korap:docGroup",
+    "operation":"operation:or",
+    "operands":[
+      {
+        "@type":"korap:docGroup",
+        "operation":"operation:and",
+        "operands":[
+          {
+            "@type":"korap:doc",
+            "key":"Titel",
+            "value":"Baum",
+            "match":"match:eq"
+          },
+          {
+            "@type":"korap:doc",
+            "key":"Veröffentlichungsort",
+            "value":"hihi",
+            "match":"match:eq"
+          },
+          {
+            "@type":"korap:docGroup",
+            "operation":"operation:or",
+            "operands":[
+              {
+                "@type":"korap:doc",
+                "key":"Titel",
+                "value":"Baum",
+                "match":"match:eq"
+              },
+              {
+                "@type":"korap:doc",
+                "key":"Veröffentlichungsort",
+                "value":"hihi",
+                "match":"match:eq"
+              }
+            ]
+          }
+        ]
+      },
+      {
+        "@type":"korap:doc",
+        "key":"Untertitel",
+        "value":"huhu",
+        "match":"match:eq"
+      }
+    ]
+  });
   
   it('should be initializable', function () {
     var vc = KorAP.VirtualCollection.render();
@@ -945,6 +994,30 @@
       'author = "Max Birkendale" | title = "Der Birnbaum" | pubDate in 2014-12-05'
     );
   });
+
+  it('should be reducible to unspecification', function () {
+    var vc = demoFactory.create();
+
+    expect(vc.toString()).toEqual(vc.root().toString());
+
+    expect(vc.toString()).toEqual('(Titel = "Baum" & Veröffentlichungsort = "hihi" & (Titel = "Baum" | Veröffentlichungsort = "hihi")) | Untertitel = "huhu"');
+
+    expect(vc.root().element().lastChild.children[0].firstChild.nodeValue).toEqual('and');
+    expect(vc.root().element().lastChild.children[1].firstChild.nodeValue).toEqual('×');
+
+    expect(vc.root().delOperand(vc.root().getOperand(0)).update()).not.toBeUndefined();
+
+    expect(vc.toString()).toEqual('Untertitel = "huhu"');
+
+    expect(vc.root().element().lastChild.children[0].firstChild.nodeValue).toEqual('and');
+    expect(vc.root().element().lastChild.children[1].firstChild.nodeValue).toEqual('or');
+    expect(vc.root().element().lastChild.children[2].firstChild.nodeValue).toEqual('×');
+
+    // Clean everything
+    vc.clean();
+    expect(vc.toString()).toEqual('⋯');    
+
+  });
 });
 
 describe('KorAP.Operators', function () {
diff --git a/public/js/src/vc.js b/public/js/src/vc.js
index 03911ce..290531a 100644
--- a/public/js/src/vc.js
+++ b/public/js/src/vc.js
@@ -50,6 +50,27 @@
       node.removeChild(node.firstChild);
   };
 
+
+  // Add 'or'-criterion
+  KorAP._or = function (e) {
+    var obj = this.parentNode.refTo;
+  };
+
+
+  // Add 'and'-criterion
+  KorAP._and = function (e) {
+    var obj = this.parentNode.refTo;
+  };
+
+  // Remove doc or docGroup
+  KorAP._delete = function (e) {
+    var obj = this.parentNode.refTo;
+    if (obj.parent().ldType() !== null)
+      obj.parent().delOperand(obj).update();
+    else
+      obj.parent().clean();
+  };
+
   KorAP.VirtualCollection = {
     ldType : function () {
       return null;
@@ -57,6 +78,13 @@
     create : function () {
       return Object.create(KorAP.VirtualCollection);
     },
+    clean : function () {
+      if (this._root.ldType() !== "non") {
+	this._root.destroy();
+	this.root(KorAP.UnspecifiedDoc.create(this));
+      };
+      return this;
+    },
     render : function (json) {
       var obj = Object.create(KorAP.VirtualCollection);
 
@@ -129,19 +157,6 @@
     }
   };
 
-  KorAP._or = function (e) {
-    var obj = this.parentNode.refTo;
-  };
-
-  KorAP._and = function (e) {
-    var obj = this.parentNode.refTo;
-  };
-
-  KorAP._delete = function (e) {
-    var obj = this.parentNode.refTo;
-    obj.parent().delOperand(obj).update();
-  };
-
   /**
    * Operators for criteria
    */
@@ -239,7 +254,7 @@
    * Unspecified criterion
    */
   KorAP.UnspecifiedDoc = {
-    _ldType : "doc",
+    _ldType : "non",
     create : function (parent) {
       var obj = Object.create(KorAP.JsonLD).
 	upgradeTo(KorAP.UnspecifiedDoc);
@@ -250,6 +265,7 @@
       return obj;
     },
     update : function () {
+
       if (this._element === undefined)
 	return this.element();
 
@@ -357,9 +373,7 @@
 	var op = this.operators(
 	  true,
 	  true,
-	  // No delete object, if this is the root
-	  (this._parent !== undefined &&
-	   this.parent().ldType() !== null) ? true : false
+	  true
 	);
 
 	// Append new operators
