diff --git a/dev/js/spec/vcSpec.js b/dev/js/spec/vcSpec.js
index bab1747..61c3099 100644
--- a/dev/js/spec/vcSpec.js
+++ b/dev/js/spec/vcSpec.js
@@ -2872,6 +2872,7 @@
     });
   });
 
+  // Check fragment handling for corpusByMatch helper
   describe('KorAP.VC.Fragment', function () {
     it('should be initializable', function () {
       var f = fragmentClass.create();
@@ -2923,10 +2924,15 @@
 
     it('should be reducible', function () {
       var f = fragmentClass.create();
+      expect(f.element().children.length).toEqual(0);
+
       f.add("author", "Peter");
       f.add("title", "Example");
 
+      expect(f.element().children.length).toEqual(1);
+      
       var root = f.element().firstChild;
+      
       expect(root.classList.contains("docGroup")).toBeTruthy();
 
       expect(root.children.length).toEqual(2);
@@ -2942,6 +2948,10 @@
       expect(root.children[1].textContent).toEqual("eq");
       expect(root.children[2].tagName).toEqual("SPAN");
       expect(root.children[2].textContent).toEqual("Example");
+
+      f.remove("title","Example");
+
+      expect(f.element().children.length).toEqual(0);
     });
   });
 });
diff --git a/dev/js/src/vc/fragment.js b/dev/js/src/vc/fragment.js
index a1892c8..9b87ee2 100644
--- a/dev/js/src/vc/fragment.js
+++ b/dev/js/src/vc/fragment.js
@@ -1,6 +1,6 @@
 /**
  * Create a virtual corpus fragment,
- * that can be shown and merge with the
+ * that can be shown and merged with the
  * main VC.
  *
  * @author Nils Diewald
@@ -29,11 +29,11 @@
     return doc;
   };
 
-  
+  // Return object
   return {
 
     create : function () {
-      var obj = Object.create(this);
+      const obj = Object.create(this);
       obj._operands = [];
       return obj;
     },
@@ -43,8 +43,8 @@
      * Add document constraint to fragment
      */
     add : function (key, value, type) {
-      for (var i in this._operands) {
-        var op = this._operands[i];
+      for (let i in this._operands) {
+        let op = this._operands[i];
         if (op[0] === key && op[1] === value) {
           array.splice(index, 1);
         };
@@ -58,8 +58,8 @@
      * Remove document constraint from fragment
      */
     remove : function (key, value) {
-      for (var i in this._operands) {
-        var op = this._operands[i];
+      for (let i in this._operands) {
+        let op = this._operands[i];
         if (op[0] === key && op[1] === value) {
           this._operands.splice(i, 1);
           this.update();
@@ -69,6 +69,12 @@
       return;
     },
 
+    /**
+     * Check, if the fragment contains any constraints
+     */
+    isEmpty : function () {
+      return this._operands.length > 0 ? false : true;
+    },
     
     /**
      * Add fragment constraints to VC.
@@ -103,15 +109,15 @@
       //     <span class="value">Baum</span>
       //   </div>
       // </div>
-      var root;
-      var l = this._operands.length;
+      let root;
+      let l = this._operands.length;
       if (l > 1) {
 
         root = document.createElement('div');
         root.setAttribute('class','docGroup');
         root.setAttribute('data-operation', 'and');
 
-        for (var i in this._operands) {
+        for (let i in this._operands) {
           root.appendChild(_doc(this._operands[i]));
         };
       }
@@ -119,8 +125,11 @@
         root = _doc(this._operands[0]);
       };
 
-      var e = this.element();
-      if (e.firstChild)
+      const e = this.element();
+      if (l === 0) {
+        _removeChildren(e);
+      }
+      else if (e.firstChild)
         e.replaceChild(root, e.firstChild);
       else
         e.appendChild(root);
