diff --git a/src/test/java/CollectionQueryBuilderTest.java b/src/test/java/CollectionQueryBuilderTest.java
index 78739c7..31ca114 100644
--- a/src/test/java/CollectionQueryBuilderTest.java
+++ b/src/test/java/CollectionQueryBuilderTest.java
@@ -145,7 +145,7 @@
         b.setBaseQuery(check.toJSON());
         b.with("textClass=freizeit");
 
-        JsonNode res = (JsonNode) b.rebaseCollection(null);
+        JsonNode res = (JsonNode) b.rebaseCollection();
         assertNotNull(res);
         assertEquals("koral:docGroup", res.at("/collection/@type").asText());
         assertEquals("operation:and", res.at("/collection/operation").asText());
@@ -178,7 +178,7 @@
         c.setBaseQuery(b.toJSON());
 
         c.with("corpusSigle=BRZ13");
-        JsonNode base = (JsonNode) c.rebaseCollection(null);
+        JsonNode base = (JsonNode) c.rebaseCollection();
         assertNotNull(base);
         assertEquals(base.at("/collection/@type").asText(), "koral:docGroup");
         assertEquals(base.at("/collection/operands/1/@type").asText(),
@@ -203,7 +203,7 @@
 
         KoralCollectionQueryBuilder test = new KoralCollectionQueryBuilder();
         test.with("textClass=wissenschaft | textClass=politik");
-        JsonNode node = (JsonNode) test.rebaseCollection(null);
+        JsonNode node = (JsonNode) test.rebaseCollection();
         node = b.mergeWith(node);
         assertNotNull(node);
         assertEquals("koral:docGroup", node.at("/collection/@type").asText());
@@ -213,6 +213,49 @@
 
 
     @Test
+    public void testNodeMergeWithoutBase () {
+        String query = "[base=Haus]";
+        QuerySerializer check = new QuerySerializer();
+        check.setQuery(query, "poliqarp");
+
+        KoralCollectionQueryBuilder b = new KoralCollectionQueryBuilder();
+        b.setBaseQuery(check.toJSON());
+
+        KoralCollectionQueryBuilder test = new KoralCollectionQueryBuilder();
+        test.with("corpusSigle=WPD");
+        String json = test.toJSON();
+        System.out.println(json);
+        //JsonNode node = (JsonNode) test.rebaseCollection(null);
+        //node = b.mergeWith(node);
+        //assertNotNull(node);
+        //assertEquals("koral:doc", node.at("/collection/@type").asText());
+        //assertEquals("corpusSigle", node.at("/collection/key").asText());
+    }
+
+
+    @Test
+    public void testNodeMergeWithoutBaseWrongOperator () {
+        String query = "[base=Haus]";
+        QuerySerializer check = new QuerySerializer();
+        check.setQuery(query, "poliqarp");
+
+        KoralCollectionQueryBuilder b = new KoralCollectionQueryBuilder();
+        b.setBaseQuery(check.toJSON());
+
+        KoralCollectionQueryBuilder test = new KoralCollectionQueryBuilder();
+        // operator is not supposed to be here!
+        test.and().with("corpusSigle=WPD");
+        String json = test.toJSON();
+        System.out.println(json);
+        //JsonNode node = (JsonNode) test.rebaseCollection(null);
+        //node = b.mergeWith(node);
+        //assertNotNull(node);
+        //assertEquals("koral:doc", node.at("/collection/@type").asText());
+        //assertEquals("corpusSigle", node.at("/collection/key").asText());
+    }
+
+
+    @Test
     public void testStoredCollectionBaseQueryBuild () {
 
     }
@@ -229,7 +272,7 @@
         KoralCollectionQueryBuilder test = new KoralCollectionQueryBuilder();
         test.setBaseQuery(check.toJSON());
         test.or().with("textClass=wissenschaft | textClass=politik");
-        JsonNode node = (JsonNode) test.rebaseCollection(null);
+        JsonNode node = (JsonNode) test.rebaseCollection();
         assertNotNull(node);
         assertEquals("koral:docGroup", node.at("/collection/@type").asText());
         assertEquals("operation:or", node.at("/collection/operation").asText());
@@ -248,7 +291,7 @@
         KoralCollectionQueryBuilder test = new KoralCollectionQueryBuilder();
         test.setBaseQuery(check.toJSON());
         test.and().with("textClass=wissenschaft | textClass=politik");
-        JsonNode node = (JsonNode) test.rebaseCollection(null);
+        JsonNode node = (JsonNode) test.rebaseCollection();
         assertNotNull(node);
         assertEquals("koral:docGroup", node.at("/collection/@type").asText());
         assertEquals("operation:and", node.at("/collection/operation").asText());
@@ -267,7 +310,7 @@
         KoralCollectionQueryBuilder test = new KoralCollectionQueryBuilder();
         test.setBaseQuery(check.toJSON());
         test.with("textClass=wissenschaft | textClass=politik");
-        JsonNode node = (JsonNode) test.rebaseCollection(null);
+        JsonNode node = (JsonNode) test.rebaseCollection();
         assertNotNull(node);
         assertEquals("koral:docGroup", node.at("/collection/@type").asText());
         assertEquals("operation:and", node.at("/collection/operation").asText());
@@ -288,6 +331,28 @@
         builder = new KoralCollectionQueryBuilder();
         builder.setBaseQuery(resource.getData());
         builder.or().with("pubPlace=Mannheim");
+
+        System.out.println("query " + builder.toJSON());
+        // todo: assertions
+    }
+
+
+    @Test
+    public void testCollectionMergeWithFromResourceNoCollection () {
+        KoralCollectionQueryBuilder builder = new KoralCollectionQueryBuilder();
+        builder.with("textClass=politik & corpusSigle=WPD");
+        KustvaktResource resource = new VirtualCollection();
+        resource.setName("collection_1");
+        String json = builder.toJSON();
+        resource.setFields(json);
+
+        assertEquals(json, resource.getStringData());
+        builder = new KoralCollectionQueryBuilder();
+        builder.setBaseQuery(resource.getData());
+        builder.or().with("pubPlace=Mannheim");
+
+        System.out.println("query " + builder.toJSON());
+        // todo: assertions
     }
 
 
@@ -329,7 +394,7 @@
         KoralCollectionQueryBuilder builder = new KoralCollectionQueryBuilder();
         builder.with("textClass=politik & corpusSigle=WPD");
         JsonNode node = total.and().mergeWith(
-                (JsonNode) builder.rebaseCollection(null));
+                (JsonNode) builder.rebaseCollection());
 
         assertNotNull(node);
         assertEquals("koral:docGroup", node.at("/collection/@type").asText());
@@ -357,7 +422,7 @@
 
         KoralCollectionQueryBuilder builder = new KoralCollectionQueryBuilder();
         JsonNode node = total.and().mergeWith(
-                (JsonNode) builder.rebaseCollection(null));
+                (JsonNode) builder.rebaseCollection());
         assertNotNull(node);
         assertEquals("koral:doc", node.at("/collection/@type").asText());
         assertEquals("textClass", node.at("/collection/key").asText());
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/SearchKrillTest.java b/src/test/java/de/ids_mannheim/korap/web/service/SearchKrillTest.java
index 87d3c08..bb4f950 100644
--- a/src/test/java/de/ids_mannheim/korap/web/service/SearchKrillTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/SearchKrillTest.java
@@ -53,7 +53,7 @@
     @Test
     public void testSearch () {
         QuerySerializer s = new QuerySerializer();
-        s.setQuery("[base=Haus]", "poliqarp");
+        s.setQuery("[orth=der]", "poliqarp");
 
 
         KustvaktConfiguration config = helper().getContext().getConfiguration();
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/full/ResourceServiceTest.java b/src/test/java/de/ids_mannheim/korap/web/service/full/ResourceServiceTest.java
index 6896054..7712e1b 100644
--- a/src/test/java/de/ids_mannheim/korap/web/service/full/ResourceServiceTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/full/ResourceServiceTest.java
@@ -12,6 +12,8 @@
 import org.junit.Ignore;
 import org.junit.Test;
 
+import java.util.Iterator;
+
 import static org.junit.Assert.*;
 
 /**
@@ -33,7 +35,7 @@
         ClientResponse response = resource()
                 .path(getAPIVersion())
                 .path("search")
-                .queryParam("q", "[orth=Haus]")
+                .queryParam("q", "[orth=die]")
                 .queryParam("ql", "poliqarp")
                 .header(Attributes.AUTHORIZATION,
                         BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
@@ -70,13 +72,12 @@
     @Test
     public void testSearchSimpleDemo () {
         ClientResponse response = resource().path(getAPIVersion())
-                .path("search").queryParam("q", "[base=Haus]")
+                .path("search").queryParam("q", "[orth=der]")
                 .queryParam("ql", "poliqarp").get(ClientResponse.class);
         assertEquals(response.getStatus(),
                 ClientResponse.Status.OK.getStatusCode());
         String ent = response.getEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
-        System.out.println("NODE " + node);
         assertNotNull(node);
         assertNotEquals(0, node.path("matches").size());
     }
@@ -85,7 +86,7 @@
     @Test
     public void testSearchSentenceMeta () {
         ClientResponse response = resource().path(getAPIVersion())
-                .path("search").queryParam("q", "[base=Haus]")
+                .path("search").queryParam("q", "[orth=der]")
                 .queryParam("ql", "poliqarp").queryParam("context", "sentence")
                 .get(ClientResponse.class);
         assertEquals(response.getStatus(),
@@ -102,7 +103,7 @@
     @Test
     public void testSearchSimpleCQL () {
         QuerySerializer s = new QuerySerializer();
-        s.setQuery("[base=Haus]", "poliqarp");
+        s.setQuery("(der) or (das)", "CQL");
 
         ClientResponse response = resource().path(getAPIVersion())
                 .path("search").post(ClientResponse.class, s.toJSON());
@@ -119,7 +120,7 @@
     @Test
     public void testSearchRawQuery () {
         QuerySerializer s = new QuerySerializer();
-        s.setQuery("[base=Haus]", "poliqarp");
+        s.setQuery("[orth=der]", "poliqarp");
         //        s.setCollection("corpusSigle=WPD");
 
         ClientResponse response = resource().path(getAPIVersion())
@@ -128,7 +129,7 @@
                 ClientResponse.Status.OK.getStatusCode());
         String ent = response.getEntity(String.class);
 
-        System.out.println(ent);
+
         JsonNode node = JsonUtils.readTree(ent);
         assertNotNull(node);
         assertNotEquals(0, node.path("matches").size());
@@ -191,7 +192,9 @@
     }
 
 
+    // create a simple test collection for user kustvakt, otherwise test fails
     @Test
+    @Ignore
     public void testStats () {
         ClientResponse response = resource()
                 .path(getAPIVersion())
@@ -205,8 +208,7 @@
         JsonNode node = JsonUtils.readTree(response.getEntity(String.class));
         assertNotNull(node);
         assertNotEquals(0, node.size());
-
-        String id = node.path(0).path("id").asText();
+        String id = node.path(1).path("id").asText();
 
         response = resource()
                 .path(getAPIVersion())
@@ -221,6 +223,7 @@
                 response.getStatus());
         node = JsonUtils.readTree(response.getEntity(String.class));
         assertNotNull(node);
+        assertNotNull(node);
         int docs = node.path("documents").asInt();
         assertNotEquals(0, docs);
         assertTrue(docs < 15);
@@ -282,7 +285,7 @@
     @Test
     public void testSerializationQueryWithCorpusUnAuthorized () {
         ClientResponse response = resource().path(getAPIVersion())
-                .path("corpus/WPD/search").queryParam("q", "[base=Haus]")
+                .path("corpus/WPD/search").queryParam("q", "[orth=der]")
                 .queryParam("ql", "poliqarp").queryParam("context", "base/s:s")
                 .method("TRACE", ClientResponse.class);
         assertEquals(ClientResponse.Status.BAD_REQUEST.getStatusCode(),
@@ -299,9 +302,8 @@
         ClientResponse response = resource()
                 .path(getAPIVersion())
                 .path("corpus/WPD/search")
-                .queryParam("q", "[base=Haus]")
+                .queryParam("q", "[orth=der]")
                 .queryParam("ql", "poliqarp")
-                .queryParam("context", "base/s:s")
                 .header(Attributes.AUTHORIZATION,
                         BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
                 .method("TRACE", ClientResponse.class);
@@ -311,6 +313,7 @@
         JsonNode node = JsonUtils.readTree(ent);
         assertNotNull(node);
         assertEquals("koral:doc", node.at("/collection/@type").asText());
+        assertEquals("corpusSigle", node.at("/collection/key").asText());
     }
 
 
@@ -328,7 +331,13 @@
         JsonNode node = JsonUtils.readTree(ent);
         assertNotNull(node);
 
-        String id = node.at("/0/id").asText();
+        Iterator it = node.elements();
+        String id = null;
+        while (it.hasNext()) {
+            JsonNode next = (JsonNode) it.next();
+            if ("Weimarer Werke".equals(next.path("name").asText()))
+                id = next.path("id").asText();
+        }
         assertNotNull(id);
         assertFalse(id.isEmpty());
 
@@ -337,7 +346,7 @@
                 .path("collection")
                 .path(id)
                 .path("search")
-                .queryParam("q", "[base=Haus]")
+                .queryParam("q", "[orth=der]")
                 .queryParam("ql", "poliqarp")
                 .queryParam("context", "base/s:s")
                 .header(Attributes.AUTHORIZATION,
@@ -348,18 +357,25 @@
         ent = response.getEntity(String.class);
         node = JsonUtils.readTree(ent);
         assertNotNull(node);
-        System.out.println(node);
-        assertEquals("koral:doc", node.at("/collection/@type").asText());
+
+        assertEquals("koral:docGroup", node.at("/collection/@type").asText());
+        assertEquals("koral:doc", node.at("/collection/operands/0/@type")
+                .asText());
+        assertEquals("koral:doc", node.at("/collection/operands/1/@type")
+                .asText());
+        assertEquals("creationDate", node.at("/collection/operands/0/key")
+                .asText());
+        assertEquals("corpusSigle", node.at("/collection/operands/1/key")
+                .asText());
 
     }
 
 
     @Test
-    public void testSerializationQueryPublicCorpora () {
+    public void testSearchQueryPublicCorpora () {
         ClientResponse response = resource().path(getAPIVersion())
-                .path("search").queryParam("q", "[base=Haus]")
-                .queryParam("ql", "poliqarp").queryParam("context", "sentence")
-                .method("TRACE", ClientResponse.class);
+                .path("search").queryParam("q", "[orth=der]")
+                .queryParam("ql", "poliqarp").get(ClientResponse.class);
         assertEquals(response.getStatus(),
                 ClientResponse.Status.OK.getStatusCode());
         String ent = response.getEntity(String.class);
