diff --git a/dev/js/src/init.js b/dev/js/src/init.js
index 0e49091..1749e6d 100644
--- a/dev/js/src/init.js
+++ b/dev/js/src/init.js
@@ -27,6 +27,8 @@
   var loc = KorAP.Locale;
   loc.VC_allCorpora    = loc.VC_allCorpora  || 'all Corpora';
   loc.VC_oneCollection = loc.VC_oneCollection  || 'one Collection';
+  loc.TOGGLE_ALIGN = loc.TOGGLE_ALIGN  || 'toggle Alignment';
+  loc.SHOW_KQ = loc.SHOW_KQ  || 'show KoralQuery';
 
   // Override KorAP.log
   window.alertify = alertifyClass;
@@ -71,7 +73,7 @@
 
       vcname.appendChild(
 	document.createTextNode(
-	  document.getElementById('vc-name').value || currentVC
+	  document.getElementById('collection-name').value || currentVC
 	)
       );
 
@@ -97,29 +99,68 @@
       });
     };
 
+    var result = document.getElementById('resultinfo');
+    var resultButton;
+    if (result != null) {
+      resultButton = result.appendChild(document.createElement('div'));
+      resultButton.classList.add('result', 'button'); 
+    };
+
+    // There is a koralQuery
+    if (KorAP.koralQuery !== undefined && resultButton !== null) {
+      var kq;
+      
+      var toggle = document.createElement('a');
+      toggle.setAttribute('title', loc.SHOW_KQ)
+      toggle.classList.add('show-kq', 'button');
+      toggle.appendChild(document.createElement('span'))
+	.appendChild(document.createTextNode(loc.SHOW_KQ));
+      resultButton.appendChild(toggle);
+
+      if (toggle !== undefined) {
+      
+	// Show koralquery
+	toggle.addEventListener(
+	  'click', function () {
+	    if (kq === undefined) {
+	      kq = document.createElement('div');
+	      kq.setAttribute('id', 'koralquery');
+	      kq.style.display = 'none';
+	      var kqInner = document.createElement('div');
+	      kq.appendChild(kqInner);
+	      kqInner.innerHTML = JSON.stringify(KorAP.koralQuery, null, '  ');
+	      hljs.highlightBlock(kqInner);
+	      var sb = document.getElementById('search');
+	      sb.insertBefore(kq, sb.firstChild);
+	    };
+
+	    kq.style.display = (kq.style.display === 'none') ? 'block' : 'none';
+	  }
+	);
+      };
+    };
+
 
     /**
      * Toggle the alignment (left <=> right)
      */
-    if (i > 0) {
-      var br = document.querySelector('div.button.right');
-      if (br !== null) {
-	var toggle = document.createElement('a');
-	toggle.setAttribute('title', 'toggle Alignment');
-	// Todo: Reuse old alignment from cookie!
-	var cl = toggle.classList;
-	cl.add('align', 'right');
-	toggle.addEventListener(
-	  'click',
-	  function (e) {
-	    var ol = document.querySelector('#search > ol');
-	    ol.toggleClass("align-left", "align-right");
-	    this.toggleClass("left", "right");
-	  });
-	toggle.appendChild(document.createElement('span'))
-	  .appendChild(document.createTextNode('Alignment'));
-	br.appendChild(toggle);
-      };
+    // querySelector('div.button.right');
+    if (i > 0 && resultButton !== null) {
+      var toggle = document.createElement('a');
+      toggle.setAttribute('title', loc.TOGGLE_ALIGN);
+      // Todo: Reuse old alignment from query
+      var cl = toggle.classList;
+      cl.add('align', 'right', 'button');
+      toggle.addEventListener(
+	'click',
+	function (e) {
+	  var ol = document.querySelector('#search > ol');
+	  ol.toggleClass("align-left", "align-right");
+	  this.toggleClass("left", "right");
+	});
+      toggle.appendChild(document.createElement('span'))
+	.appendChild(document.createTextNode(loc.TOGGLE_ALIGN));
+      resultButton.appendChild(toggle);
     };
 
 
@@ -127,14 +168,16 @@
      * Toggle the Virtual Collection builder
      */
     if (vcname) {
+      var collectionShow = document.getElementById('collection-show');
       var vc;
-      vcname.onclick = function () {
+      var vcclick = function () {
 	var view = document.getElementById('vc-view');
 
 	// The vc is visible
 	if (this.classList.contains('active')) {
 	  view.removeChild(vc.element());
 	  this.classList.remove('active');
+	  delete collectionShow['value'];
 	}
 
 	// The vc is not visible
@@ -143,8 +186,13 @@
 	    vc = _getCurrentVC(vcClass, vcArray);
 	  view.appendChild(vc.element());
 	  this.classList.add('active');
+	  collectionShow.value = 'true';
 	};
       };
+      vcname.onclick = vcclick;
+      if (collectionShow.value === 'true') {
+	vcclick.apply();
+      };
     };
 
   
@@ -170,21 +218,6 @@
     // Initialize documentation links
     obj.tutorial.initDocLinks(document);
 
-    // There is a currentQuery
-    /*
-    if (KorAP.koralQuery !== undefined) {
-      var kq = document.createElement('div');
-      kq.setAttribute('id', 'koralquery');
-
-      var kqInner = document.createElement('div');
-      kq.appendChild(kqInner);
-      kqInner.innerHTML = JSON.stringify(KorAP.koralQuery, null, '  ');
-      hljs.highlightBlock(kqInner);
-
-      var sb = document.getElementById('search');
-      sb.insertBefore(kq, sb.firstChild);
-    };
-    */
 
     /**
      * Add VC creation on submission.
diff --git a/dev/js/src/loc/de.js b/dev/js/src/loc/de.js
index fce90a1..ab443f4 100644
--- a/dev/js/src/loc/de.js
+++ b/dev/js/src/loc/de.js
@@ -28,4 +28,7 @@
   loc.ADDTREE  = 'Baumansicht hinzufügen';
   loc.SHOWINFO = 'Informationen';
   loc.CLOSE    = 'Schließen';
+
+  loc.TOGGLE_ALIGN = 'tausche Textausrichtung';
+  loc.SHOW_KQ      = 'zeige KoralQuery';
 });
diff --git a/dev/js/src/vc.js b/dev/js/src/vc.js
index 0685242..b607f2c 100644
--- a/dev/js/src/vc.js
+++ b/dev/js/src/vc.js
@@ -110,9 +110,12 @@
 	KorAP._vcMatchopMenu = {
 	  'string' : menuClass.create([
 	    ['eq', null],
-	    ['ne', null],
+	    ['ne', null]
+/*
+  ,
 	    ['contains', null],
 	    ['excludes', null]
+*/
 	  ]),
 	  'date' : menuClass.create([
 	    ['eq', null],
@@ -121,9 +124,9 @@
 	  ]),
 	  'regex' : menuClass.create([
 	    ['eq', null],
-	    ['ne', null],
+	    ['ne', null]/*,
 	    ['contains', null],
-	    ['excludes', null]
+	    ['excludes', null]*/
 	  ])
 	};
       };
