diff --git a/Changes b/Changes
index 3b86823..d9ed869 100644
--- a/Changes
+++ b/Changes
@@ -1,4 +1,4 @@
-0.52 2015-06-17
+0.52 2015-06-23
         - [bugfix] Fixed payload filtering in FocusSpans (margaretha)
 	- [workaround] Reintroduced empty collection support,
 	  as Koral still creates them (diewald)
@@ -7,6 +7,7 @@
 	- [feature] Made responses valid KoralQueries (diewald)
 	- [bugfix] Fixed sequence deserialization bug for simple unordered
 	  constraint (diewald)
+	- [bugfix] Mirror collection (diewald)
 
 0.51 2015-03-17
         - This is a major version (prepared for the GitHub release)
diff --git a/src/main/java/de/ids_mannheim/korap/Krill.java b/src/main/java/de/ids_mannheim/korap/Krill.java
index 112112d..8a5789a 100644
--- a/src/main/java/de/ids_mannheim/korap/Krill.java
+++ b/src/main/java/de/ids_mannheim/korap/Krill.java
@@ -166,7 +166,6 @@
         if (json.has("query")) {
             try {
                 KrillQuery kq = new KrillQuery("tokens");
-
                 SpanQueryWrapper qw = kq.fromJson(json.get("query"));
 
                 this.setQuery(kq);
@@ -209,11 +208,13 @@
         try {
             if (json.has("collection")) {
                 JsonNode collNode = json.get("collection");
+
                 // TODO: Temporary
-                if (collNode.fieldNames().hasNext())
-                    this.setCollection(
-                        new KrillCollection().fromJson(collNode)
-                    );
+                if (collNode.fieldNames().hasNext()) {
+                    KrillCollection kc = new KrillCollection()
+                            .fromJson(collNode);
+                    this.setCollection(kc);
+                };
             }
 
             // <legacycode>
@@ -303,14 +304,16 @@
 
         // Apply search
         else {
+
+            // This contains meta and matches
             kr = this.index.search(this);
-            this.getCollection().setIndex(this.index);
+            // this.getCollection().setIndex(this.index);
             kr.copyNotificationsFrom(this);
         };
 
-        // TODO: Only for development mode
-        kr.setRequest(this.request);
+        // kr.setRequest(this.request);
         kr.setQuery(this.getQuery());
+        kr.setCollection(this.getCollection());
 
         return kr;
     };
diff --git a/src/main/java/de/ids_mannheim/korap/KrillCollection.java b/src/main/java/de/ids_mannheim/korap/KrillCollection.java
index 539427b..5d7d736 100644
--- a/src/main/java/de/ids_mannheim/korap/KrillCollection.java
+++ b/src/main/java/de/ids_mannheim/korap/KrillCollection.java
@@ -59,6 +59,7 @@
     private String id;
     private ArrayList<FilterOperation> filter;
     private int filterCount = 0;
+    private JsonNode json;
 
     // Logger
     private final static Logger log = LoggerFactory
@@ -158,6 +159,7 @@
      * @throws QueryException
      */
     public KrillCollection fromJson (JsonNode json) throws QueryException {
+        this.json = json;
         this.filter(this._fromJson(json));
         return this;
     };
@@ -617,6 +619,22 @@
 
 
     /**
+     * Return the associated KoralQuery collection object
+     * as a {@link JsonNode}. This won't work,
+     * if the object was build using a CollectionBuilder,
+     * therefore it is limited to mirror a deserialized KoralQuery
+     * object.
+     * 
+     * @return The {@link JsonNode} representing the collection object
+     *         of a deserialized KoralQuery object.
+     */
+    public JsonNode toJsonNode () {
+        return this.json;
+    };
+
+
+
+    /**
      * Search in the virtual collection.
      * This is mostly used for testing purposes
      * and <strong>is not recommended</strong>
diff --git a/src/main/java/de/ids_mannheim/korap/KrillQuery.java b/src/main/java/de/ids_mannheim/korap/KrillQuery.java
index 3fe6f28..3bf8bcd 100644
--- a/src/main/java/de/ids_mannheim/korap/KrillQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/KrillQuery.java
@@ -121,6 +121,7 @@
         };
     };
 
+
     /**
      * Constructs a new object for query deserialization
      * and building. Expects the name of an index field
@@ -281,12 +282,14 @@
                     SpanSubspanQueryWrapper ssqw = new SpanSubspanQueryWrapper(
                             sqw, startOffset, length);
                     return ssqw;
-                };
+                }
+                ;
 
                 if (DEBUG)
                     log.trace("Wrap class reference {}", number);
 
-                return new SpanFocusQueryWrapper(this._fromJson(operands.get(0)), number);
+                return new SpanFocusQueryWrapper(
+                        this._fromJson(operands.get(0)), number);
 
             case "koral:token":
 
@@ -384,7 +387,8 @@
         if (DEBUG)
             log.trace("Operands are {}", operands);
 
-        SpanQueryWrapper spanReferenceQueryWrapper = _operationReferenceFromJSON(json, operands);
+        SpanQueryWrapper spanReferenceQueryWrapper = _operationReferenceFromJSON(
+                json, operands);
         if (spanReferenceQueryWrapper != null) {
             return spanReferenceQueryWrapper;
         }
@@ -428,8 +432,9 @@
         throw new QueryException(711, "Unknown group operation");
     };
 
-    private SpanQueryWrapper _operationReferenceFromJSON(JsonNode node, JsonNode operands)
-            throws QueryException {
+
+    private SpanQueryWrapper _operationReferenceFromJSON (JsonNode node,
+            JsonNode operands) throws QueryException {
         boolean isReference = false;
         int classNum = -1;
         int refOperandNum = -1;
@@ -464,7 +469,8 @@
         return null;
     }
 
-    private JsonNode _resolveReference(JsonNode node, JsonNode operands,
+
+    private JsonNode _resolveReference (JsonNode node, JsonNode operands,
             int refOperandNum, int classNum) throws QueryException {
         JsonNode referent = null;
         ObjectMapper m = new ObjectMapper();
@@ -474,7 +480,8 @@
             if (i != refOperandNum) {
                 if (!isReferentFound) {
                     referent = _extractReferentClass(operands.get(i), classNum);
-                    if (referent != null) isReferentFound = true;
+                    if (referent != null)
+                        isReferentFound = true;
                 }
                 newOperands.insert(i, operands.get(i));
             }
@@ -490,7 +497,8 @@
 
     }
 
-    private JsonNode _extractReferentClass(JsonNode node, int classNum) {
+
+    private JsonNode _extractReferentClass (JsonNode node, int classNum) {
         JsonNode referent;
         if (node.has("classOut") && node.get("classOut").asInt() == classNum) {
             // System.out.println("found: " + node.toString());
@@ -520,7 +528,7 @@
 
         SpanQueryWrapper operand1 = this._fromJson(operands.get(0));
         SpanQueryWrapper operand2 = this._fromJson(operands.get(1));
-        
+
         String direction = ">:";
         if (operand1.isEmpty() && !operand2.isEmpty()) {
             direction = "<:";
@@ -529,14 +537,13 @@
         if (!relation.has("@type"))
             throw new QueryException(701,
                     "JSON-LD group has no @type attribute");
-        
+
         if (relation.get("@type").asText().equals("koral:relation")) {
             if (!relation.has("wrap")) {
                 throw new QueryException(718, "Missing relation term");
             }
             SpanQueryWrapper relationWrapper = _termFromJson(
-                    relation.get("wrap"),
-                    direction);
+                    relation.get("wrap"), direction);
             return new SpanRelationWrapper(relationWrapper, operand1, operand2);
         }
         else {
@@ -730,7 +737,8 @@
                     "Span references are currently not supported");
         };
 
-        return new SpanFocusQueryWrapper(this._fromJson(operands.get(0)), number);
+        return new SpanFocusQueryWrapper(this._fromJson(operands.get(0)),
+                number);
     };
 
 
@@ -1039,7 +1047,7 @@
 
         // <legacy>
         if (json.has("caseInsensitive")
-            && json.get("caseInsensitive").asBoolean()) {
+                && json.get("caseInsensitive").asBoolean()) {
             isCaseInsensitive = true;
         }
         // </legacy>
diff --git a/src/main/java/de/ids_mannheim/korap/index/MultiTerm.java b/src/main/java/de/ids_mannheim/korap/index/MultiTerm.java
index ec5079b..b009e7b 100644
--- a/src/main/java/de/ids_mannheim/korap/index/MultiTerm.java
+++ b/src/main/java/de/ids_mannheim/korap/index/MultiTerm.java
@@ -304,7 +304,7 @@
      * Offsets are attached following a hash sign,
      * payloads are attached following a dollar sign.
      * All payloads are written as UTF-8 character sequences.
-     *
+     * 
      * <b>For the moment this is only for testing purposes!</b>
      * 
      * @see #toStringShort().
@@ -457,26 +457,29 @@
                 }
                 catch (NumberFormatException e) {
                     throw new CorpusDataException(952,
-                            "Given offset information is not numeric in " + termSurface[0]);
+                            "Given offset information is not numeric in "
+                                    + termSurface[0]);
                 };
             }
             else {
                 throw new CorpusDataException(953,
-                        "Given offset information is incomplete in " + termSurface[0]);
+                        "Given offset information is incomplete in "
+                                + termSurface[0]);
             };
         };
         this.term = _unescape(stringOffset[0]);
     };
 
+
     // Escape the term
     private String _escape (String term) {
         return term.replaceAll("([#\\$\\\\])", "\\\\$1");
     };
-    
+
+
     // Unescape the term
     private String _unescape (String term) {
-        return term.replace("\\\\","\\")
-            .replace("\\#", "#")
-            .replace("\\$", "$");
+        return term.replace("\\\\", "\\").replace("\\#", "#")
+                .replace("\\$", "$");
     };
 };
diff --git a/src/main/java/de/ids_mannheim/korap/query/SimpleSpanQuery.java b/src/main/java/de/ids_mannheim/korap/query/SimpleSpanQuery.java
index de1e4c8..1f28383 100644
--- a/src/main/java/de/ids_mannheim/korap/query/SimpleSpanQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/SimpleSpanQuery.java
@@ -75,8 +75,10 @@
     protected String field;
     protected boolean collectPayloads;
 
+
     public SimpleSpanQuery () {}
 
+
     /**
      * Constructs a new SimpleSpanQuery using the specified
      * {@link SpanQuery} and set whether payloads are to be collected
diff --git a/src/main/java/de/ids_mannheim/korap/query/SpanClassFilterQuery.java b/src/main/java/de/ids_mannheim/korap/query/SpanClassFilterQuery.java
index 48790bc..799c87e 100644
--- a/src/main/java/de/ids_mannheim/korap/query/SpanClassFilterQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/SpanClassFilterQuery.java
@@ -21,31 +21,33 @@
     private ClassOperation operation;
     private byte classNum1, classNum2;
 
+
     public SpanClassFilterQuery (SpanQuery sq, ClassOperation type,
-            int classNum1, int classNum2,
-            boolean collectPayloads) {
+                                 int classNum1, int classNum2,
+                                 boolean collectPayloads) {
         super(sq, collectPayloads);
         this.operation = type;
         this.classNum1 = (byte) classNum1;
         this.classNum2 = (byte) classNum2;
     }
 
+
     @Override
-    public SimpleSpanQuery clone() {
+    public SimpleSpanQuery clone () {
         return new SpanClassFilterQuery((SpanQuery) firstClause.clone(),
-                operation,
-                classNum1, classNum2, collectPayloads);
+                operation, classNum1, classNum2, collectPayloads);
     }
 
+
     @Override
-    public Spans getSpans(AtomicReaderContext context, Bits acceptDocs,
+    public Spans getSpans (AtomicReaderContext context, Bits acceptDocs,
             Map<Term, TermContext> termContexts) throws IOException {
-        return new ClassFilteredSpans(this, context, acceptDocs,
-                termContexts);
+        return new ClassFilteredSpans(this, context, acceptDocs, termContexts);
     }
 
+
     @Override
-    public String toString(String field) {
+    public String toString (String field) {
         StringBuilder sb = new StringBuilder();
         sb.append("spanClassFilter(");
         sb.append(firstClause.toString());
@@ -59,27 +61,33 @@
         return sb.toString();
     }
 
-    public ClassOperation getOperation() {
+
+    public ClassOperation getOperation () {
         return operation;
     }
 
-    public void setOperation(ClassOperation operation) {
+
+    public void setOperation (ClassOperation operation) {
         this.operation = operation;
     }
 
-    public byte getClassNum1() {
+
+    public byte getClassNum1 () {
         return classNum1;
     }
 
-    public void setClassNum1(byte classNum1) {
+
+    public void setClassNum1 (byte classNum1) {
         this.classNum1 = classNum1;
     }
 
-    public byte getClassNum2() {
+
+    public byte getClassNum2 () {
         return classNum2;
     }
 
-    public void setClassNum2(byte classNum2) {
+
+    public void setClassNum2 (byte classNum2) {
         this.classNum2 = classNum2;
     }
 
diff --git a/src/main/java/de/ids_mannheim/korap/query/SpanFocusQuery.java b/src/main/java/de/ids_mannheim/korap/query/SpanFocusQuery.java
index c144a58..ab29d0f 100644
--- a/src/main/java/de/ids_mannheim/korap/query/SpanFocusQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/SpanFocusQuery.java
@@ -38,6 +38,7 @@
     private boolean matchTemporaryClass = false;
     private boolean removeTemporaryClasses = false;
 
+
     /**
      * Construct a new SpanFocusQuery.
      * 
@@ -80,7 +81,7 @@
     public String toString (String field) {
         StringBuffer buffer = new StringBuffer();
         buffer.append("focus(");
-        if (matchTemporaryClass){
+        if (matchTemporaryClass) {
             buffer.append("#");
         }
         if (classNumbers.size() > 1) {
@@ -188,19 +189,23 @@
         this.isSorted = isSorted;
     }
 
-    public boolean matchTemporaryClass() {
+
+    public boolean matchTemporaryClass () {
         return matchTemporaryClass;
     }
 
-    public void setMatchTemporaryClass(boolean matchTemporaryClass) {
+
+    public void setMatchTemporaryClass (boolean matchTemporaryClass) {
         this.matchTemporaryClass = matchTemporaryClass;
     }
 
-    public boolean removeTemporaryClasses() {
+
+    public boolean removeTemporaryClasses () {
         return removeTemporaryClasses;
     }
 
-    public void setRemoveTemporaryClasses(boolean rem) {
+
+    public void setRemoveTemporaryClasses (boolean rem) {
         this.removeTemporaryClasses = rem;
     }
 
diff --git a/src/main/java/de/ids_mannheim/korap/query/SpanReferenceQuery.java b/src/main/java/de/ids_mannheim/korap/query/SpanReferenceQuery.java
index 9c2484d..3b23a18 100644
--- a/src/main/java/de/ids_mannheim/korap/query/SpanReferenceQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/SpanReferenceQuery.java
@@ -16,8 +16,9 @@
 
     private byte classNum;
 
+
     public SpanReferenceQuery (SpanQuery firstClause, byte classNum,
-            boolean collectPayloads) {
+                               boolean collectPayloads) {
         super(firstClause, collectPayloads);
         this.classNum = classNum;
     }
@@ -50,11 +51,12 @@
     }
 
 
-    public byte getClassNum() {
+    public byte getClassNum () {
         return classNum;
     }
 
-    public void setClassNum(byte classNum) {
+
+    public void setClassNum (byte classNum) {
         this.classNum = classNum;
     }
 
diff --git a/src/main/java/de/ids_mannheim/korap/query/SpanRelationMatchQuery.java b/src/main/java/de/ids_mannheim/korap/query/SpanRelationMatchQuery.java
index 5bc962a..0fac2a3 100644
--- a/src/main/java/de/ids_mannheim/korap/query/SpanRelationMatchQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/SpanRelationMatchQuery.java
@@ -12,14 +12,15 @@
 
 import de.ids_mannheim.korap.query.spans.FocusSpans;
 
-public class SpanRelationMatchQuery extends SimpleSpanQuery{
+public class SpanRelationMatchQuery extends SimpleSpanQuery {
 
     private SpanQuery operandQuery;
     private SpanQuery operand2Query;
     private SpanRelationQuery relationQuery;
 
-    public SpanRelationMatchQuery (SpanRelationQuery relation, SpanQuery operand,
-            boolean collectPayloads) {
+
+    public SpanRelationMatchQuery (SpanRelationQuery relation,
+                                   SpanQuery operand, boolean collectPayloads) {
 
         checkVariables(relation, operand);
         SpanFocusQuery sq = new SpanFocusQuery(new SpanSegmentQuery(
@@ -34,8 +35,10 @@
         this.collectPayloads = collectPayloads;
     }
 
-    public SpanRelationMatchQuery (SpanRelationQuery relation, SpanQuery source,
-            SpanQuery target, boolean collectPayloads) {
+
+    public SpanRelationMatchQuery (SpanRelationQuery relation,
+                                   SpanQuery source, SpanQuery target,
+                                   boolean collectPayloads) {
 
         checkVariables(relation, source, target);
         SpanFocusQuery sq = null;
@@ -63,7 +66,8 @@
 
     }
 
-    public void checkVariables(SpanRelationQuery relation, SpanQuery operand) {
+
+    public void checkVariables (SpanRelationQuery relation, SpanQuery operand) {
         if (relation == null) {
             throw new IllegalArgumentException(
                     "The relation query cannot be null.");
@@ -80,8 +84,10 @@
         this.relationQuery = relation;
         this.operandQuery = operand;
     }
-    
-    public void checkVariables(SpanRelationQuery relation, SpanQuery operand, SpanQuery target) {
+
+
+    public void checkVariables (SpanRelationQuery relation, SpanQuery operand,
+            SpanQuery target) {
         checkVariables(relation, operand);
         if (target == null) {
             if (operand == null) {
@@ -96,8 +102,9 @@
         this.operand2Query = target;
     }
 
+
     @Override
-    public SimpleSpanQuery clone() {
+    public SimpleSpanQuery clone () {
         if (operand2Query != null) {
             return new SpanRelationMatchQuery(
                     (SpanRelationQuery) relationQuery.clone(),
@@ -110,16 +117,18 @@
                 (SpanQuery) operandQuery.clone(), collectPayloads);
     }
 
+
     @Override
-    public Spans getSpans(AtomicReaderContext context, Bits acceptDocs,
+    public Spans getSpans (AtomicReaderContext context, Bits acceptDocs,
             Map<Term, TermContext> termContexts) throws IOException {
 
         return new FocusSpans((SpanFocusQuery) firstClause, context,
                 acceptDocs, termContexts);
     }
 
+
     @Override
-    public String toString(String field) {
+    public String toString (String field) {
         return getFirstClause().toString();
     }
 }
diff --git a/src/main/java/de/ids_mannheim/korap/query/SpanRelationQuery.java b/src/main/java/de/ids_mannheim/korap/query/SpanRelationQuery.java
index 8d06a7e..65b8786 100644
--- a/src/main/java/de/ids_mannheim/korap/query/SpanRelationQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/SpanRelationQuery.java
@@ -62,7 +62,10 @@
     private byte sourceClass;
     private byte targetClass;
 
-    private List<Byte> tempClassNumbers = Arrays.asList(tempSourceNum, tempTargetNum);
+    private List<Byte> tempClassNumbers = Arrays.asList(tempSourceNum,
+            tempTargetNum);
+
+
     /**
      * Constructs a SpanRelationQuery based on the given span query.
      * 
@@ -83,14 +86,16 @@
         }
     }
 
+
     public SpanRelationQuery (SpanQuery firstClause, List<Byte> classNumbers,
-            boolean collectPayloads) {
+                              boolean collectPayloads) {
         this(firstClause, collectPayloads);
         this.tempClassNumbers = classNumbers;
         this.tempSourceNum = classNumbers.get(0);
         this.tempTargetNum = classNumbers.get(1);
     }
 
+
     @Override
     public SimpleSpanQuery clone () {
         SimpleSpanQuery sq = new SpanRelationQuery(
@@ -132,43 +137,53 @@
         return sb.toString();
     }
 
-    public int getDirection() {
+
+    public int getDirection () {
         return direction;
     }
 
-    public void setDirection(int direction) {
+
+    public void setDirection (int direction) {
         this.direction = direction;
     }
 
-    public List<Byte> getTempClassNumbers() {
+
+    public List<Byte> getTempClassNumbers () {
         return tempClassNumbers;
     }
 
-    public void setTempClassNumbers(List<Byte> classNumbers) {
+
+    public void setTempClassNumbers (List<Byte> classNumbers) {
         this.tempClassNumbers = classNumbers;
     }
 
-    public byte getTempSourceNum() {
+
+    public byte getTempSourceNum () {
         return tempSourceNum;
     }
 
-    public void setTempSourceNum(byte sourceNum) {
+
+    public void setTempSourceNum (byte sourceNum) {
         this.tempSourceNum = sourceNum;
     }
 
-    public byte getTempTargetNum() {
+
+    public byte getTempTargetNum () {
         return tempTargetNum;
     }
 
-    public void setTempTargetNum(byte targetNum) {
+
+    public void setTempTargetNum (byte targetNum) {
         this.tempTargetNum = targetNum;
     }
 
-    public byte getSourceClass() {
+
+    public byte getSourceClass () {
         return sourceClass;
     }
 
-    public void setSourceClass(byte sourceClass)
+
+    public void setSourceClass (byte sourceClass)
             throws IllegalArgumentException {
         if (sourceClass < 1) {
             throw new IllegalArgumentException(
@@ -178,11 +193,13 @@
         this.sourceClass = sourceClass;
     }
 
-    public byte getTargetClass() {
+
+    public byte getTargetClass () {
         return targetClass;
     }
 
-    public void setTargetClass(byte targetClass)
+
+    public void setTargetClass (byte targetClass)
             throws IllegalArgumentException {
         if (targetClass < 1) {
             throw new IllegalArgumentException(
diff --git a/src/main/java/de/ids_mannheim/korap/query/SpanSegmentQuery.java b/src/main/java/de/ids_mannheim/korap/query/SpanSegmentQuery.java
index 7e75543..29189e2 100644
--- a/src/main/java/de/ids_mannheim/korap/query/SpanSegmentQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/SpanSegmentQuery.java
@@ -46,6 +46,7 @@
         this(firstClause, secondClause, true);
     }
 
+
     /**
      * Constructs a SpanSegmentQuery from the two given SpanQueries.
      * 
@@ -60,7 +61,7 @@
      *            <code>false</code>.
      */
     public SpanSegmentQuery (SpanQuery firstClause, SpanQuery secondClause,
-            boolean collectPayloads) {
+                             boolean collectPayloads) {
         super(firstClause, secondClause, collectPayloads);
         if (firstClause instanceof SpanRelationQuery) {
             isRelation = true;
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/ClassFilteredSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/ClassFilteredSpans.java
index bfd5f11..28459cf 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/ClassFilteredSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/ClassFilteredSpans.java
@@ -20,9 +20,11 @@
     private ClassOperation operation;
     private byte classNum1, classNum2;
 
+
     public ClassFilteredSpans (SpanClassFilterQuery query,
-            AtomicReaderContext context, Bits acceptDocs,
-            Map<Term, TermContext> termContexts) throws IOException {
+                               AtomicReaderContext context, Bits acceptDocs,
+                               Map<Term, TermContext> termContexts)
+            throws IOException {
         super(query, context, acceptDocs, termContexts);
         this.operation = query.getOperation();
         this.classNum1 = query.getClassNum1();
@@ -30,8 +32,9 @@
         hasMoreSpans = firstSpans.next();
     }
 
+
     @Override
-    public boolean next() throws IOException {
+    public boolean next () throws IOException {
         while (hasMoreSpans) {
             matchPayload.clear();
             bitset1 = null;
@@ -49,17 +52,21 @@
         return false;
     }
 
-    private boolean isClassOperationValid() throws IOException {
+
+    private boolean isClassOperationValid () throws IOException {
         setBitsets();
-        int cardinality = Math.max(bitset1.cardinality(), bitset2.cardinality());
+        int cardinality = Math
+                .max(bitset1.cardinality(), bitset2.cardinality());
         bitset1.and(bitset2);
         // System.out.println("cardinality:" + cardinality);
         switch (operation) {
             case DISJOINT:
-                if (bitset1.cardinality() == 0) return true;
+                if (bitset1.cardinality() == 0)
+                    return true;
                 break;
             case EQUAL:
-                if (cardinality == bitset1.cardinality()) return true;
+                if (cardinality == bitset1.cardinality())
+                    return true;
                 break;
             case DIFFER:
                 if (cardinality == 0 || cardinality != bitset1.cardinality())
@@ -71,19 +78,21 @@
                 }
                 break;
             case INTERSECT:
-                if (bitset1.cardinality() > 0) return true;
+                if (bitset1.cardinality() > 0)
+                    return true;
                 break;
         }
 
         return false;
     }
 
-    private void setBitsets() throws IOException {
+
+    private void setBitsets () throws IOException {
         BitSet bs = new BitSet();
         int start, end;
         // System.out.println("------------------------");
         for (byte[] payload : firstSpans.getPayload()) {
-            if (payload.length == 9){
+            if (payload.length == 9) {
                 start = byte2int(payload, 0) + 1;
                 end = byte2int(payload, 4) + 1;
                 if (payload[8] == classNum1) {
@@ -118,14 +127,16 @@
 
     }
 
+
     @Override
-    public boolean skipTo(int target) throws IOException {
+    public boolean skipTo (int target) throws IOException {
         // TODO Auto-generated method stub
         return false;
     }
 
+
     @Override
-    public long cost() {
+    public long cost () {
         // TODO Auto-generated method stub
         return 0;
     }
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/ClassSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/ClassSpans.java
index ac83c4d..09cc05b 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/ClassSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/ClassSpans.java
@@ -128,7 +128,7 @@
     };
 
 
-    protected boolean addClassPayload() throws IOException {
+    protected boolean addClassPayload () throws IOException {
         hasmorespans = true;
 
         classedPayload.clear();
@@ -151,7 +151,7 @@
 
         // Add highlight information as byte array
         classedPayload.add(bb.array());
-        
+
         if (spans instanceof SimpleSpans) {
             SimpleSpans ss = (SimpleSpans) spans;
             this.hasSpanId = ss.hasSpanId;
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/ReferenceSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/ReferenceSpans.java
index a860afd..cae4c5a 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/ReferenceSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/ReferenceSpans.java
@@ -16,6 +16,7 @@
 
     private byte classNum;
 
+
     public ReferenceSpans (SpanReferenceQuery query,
                            AtomicReaderContext context, Bits acceptDocs,
                            Map<Term, TermContext> termContexts)
@@ -43,7 +44,7 @@
 
 
     private boolean hasSameClassPosition () throws IOException {
-        int start=0, end=0;
+        int start = 0, end = 0;
         boolean isFound = false;
         boolean match = false;
 
@@ -52,7 +53,8 @@
         for (byte[] payload : firstSpans.getPayload()) {
             if (payload.length == 9 && payload[8] == classNum) {
                 if (isFound) {
-                    if (start == byte2int(payload, 0) && end == byte2int(payload, 4)){
+                    if (start == byte2int(payload, 0)
+                            && end == byte2int(payload, 4)) {
                         match = true;
                         continue;
                     }
@@ -86,7 +88,7 @@
 
 
     @Override
-    public long cost() {
+    public long cost () {
         return firstSpans.cost();
     }
 
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/RelationSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/RelationSpans.java
index 66afdbe..979b359 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/RelationSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/RelationSpans.java
@@ -61,6 +61,7 @@
     private byte tempSourceNum, tempTargetNum;
     private byte sourceClass, targetClass;
 
+
     /**
      * Constructs RelationSpans from the given
      * {@link SpanRelationQuery}.
@@ -251,7 +252,8 @@
         cs.setPayloads(payload);
     }
 
-    private byte[] createClassPayload(int start, int end, byte classNumber,
+
+    private byte[] createClassPayload (int start, int end, byte classNumber,
             boolean keep) {
         ByteBuffer buffer = null;
         if (keep) {
diff --git a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanReferenceQueryWrapper.java b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanReferenceQueryWrapper.java
index 02a734f..8b4c54d 100644
--- a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanReferenceQueryWrapper.java
+++ b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanReferenceQueryWrapper.java
@@ -10,8 +10,9 @@
     private SpanQueryWrapper subQuery;
     private byte classNum;
 
+
     public SpanReferenceQueryWrapper (SpanQueryWrapper subQueryWrapper,
-            byte classNum) {
+                                      byte classNum) {
         this.subQuery = subQueryWrapper;
         if (subQuery != null) {
             this.isNull = false;
@@ -30,17 +31,19 @@
         }
         this.classNum = classNum;
     }
-    
+
+
     @Override
-    public SpanQuery toQuery() throws QueryException {
+    public SpanQuery toQuery () throws QueryException {
 
         if (this.isNull() || this.isEmpty()) {
             return null;
         }
 
         SpanQuery sq = subQuery.retrieveNode(this.retrieveNode).toQuery();
-        if (sq == null) return null;
-        
+        if (sq == null)
+            return null;
+
         return new SpanReferenceQuery(sq, classNum, true);
     }
 
diff --git a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanRelationWrapper.java b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanRelationWrapper.java
index 2535ce9..992787c 100644
--- a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanRelationWrapper.java
+++ b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanRelationWrapper.java
@@ -14,8 +14,10 @@
     private SpanQueryWrapper subQuery1;
     private SpanQueryWrapper subQuery2;
 
+
     public SpanRelationWrapper (SpanQueryWrapper relationWrapper,
-            SpanQueryWrapper operand1, SpanQueryWrapper operand2) {
+                                SpanQueryWrapper operand1,
+                                SpanQueryWrapper operand2) {
 
         this.relationQuery = relationWrapper;
         if (relationQuery != null) {
@@ -35,17 +37,17 @@
 
 
     @Override
-    public SpanQuery toQuery() throws QueryException {
+    public SpanQuery toQuery () throws QueryException {
 
         if (this.isNull() || this.isEmpty()) {
             return null;
         }
 
-        SpanTermQuery relationTermQuery = (SpanTermQuery) relationQuery.retrieveNode(
-                this.retrieveNode).toQuery();
+        SpanTermQuery relationTermQuery = (SpanTermQuery) relationQuery
+                .retrieveNode(this.retrieveNode).toQuery();
         if (relationTermQuery == null)
             return null;
-        
+
         SpanRelationQuery rq = new SpanRelationQuery(relationTermQuery, true);
         SpanQuery subq1, subq2;
 
diff --git a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanSequenceQueryWrapper.java b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanSequenceQueryWrapper.java
index 08c33b1..211c113 100644
--- a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanSequenceQueryWrapper.java
+++ b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanSequenceQueryWrapper.java
@@ -477,8 +477,8 @@
             String unit, boolean exclusion) {
 
         if (DEBUG)
-            log.trace("With contraint {}-{} (unit {}, excl {})",
-                      min, max, unit, exclusion);
+            log.trace("With contraint {}-{} (unit {}, excl {})", min, max,
+                    unit, exclusion);
 
         // Word unit
         if (unit.equals("w")) {
@@ -537,8 +537,8 @@
             SpanElementQueryWrapper unit, boolean exclusion) {
 
         if (DEBUG)
-            log.trace("With contraint {}-{} (unit {}, excl {})",
-                      min, max, unit.toString(), exclusion);
+            log.trace("With contraint {}-{} (unit {}, excl {})", min, max,
+                    unit.toString(), exclusion);
 
         if (this.constraints == null)
             this.constraints = new ArrayList<DistanceConstraint>(1);
@@ -601,10 +601,8 @@
         // that will be optimized away later on
         if (this.constraints.size() == 1) {
             DistanceConstraint dc = this.constraints.get(0);
-            if (dc.getUnit().equals("w") &&
-                dc.getMinDistance() == 1 &&
-                dc.getMaxDistance() == 1 &&
-                this.isInOrder) {
+            if (dc.getUnit().equals("w") && dc.getMinDistance() == 1
+                    && dc.getMaxDistance() == 1 && this.isInOrder) {
                 return false;
             };
         };
diff --git a/src/main/java/de/ids_mannheim/korap/response/Response.java b/src/main/java/de/ids_mannheim/korap/response/Response.java
index 2af28ab..674cd0b 100644
--- a/src/main/java/de/ids_mannheim/korap/response/Response.java
+++ b/src/main/java/de/ids_mannheim/korap/response/Response.java
@@ -40,9 +40,9 @@
 
     private KrillMeta meta;
     private KrillCollection collection;
+    private KrillQuery query;
 
     private String version, name, node, listener;
-    private KrillQuery query;
 
     private long totalResources = -2, // Not set
             totalResults = -2; // Not set
@@ -403,7 +403,9 @@
         this.collection = collection;
 
         // Move messages from the collection
-        return (Response) this.moveNotificationsFrom(collection);
+        Response resp = (Response) this.moveNotificationsFrom(collection);
+
+        return resp;
     };
 
 
@@ -468,9 +470,8 @@
                 json.put("meta", metaNode);
         };
 
-        ObjectNode meta = json.has("meta") ?
-            (ObjectNode) json.get("meta") :
-            (ObjectNode) json.putObject("meta");
+        ObjectNode meta = json.has("meta") ? (ObjectNode) json.get("meta")
+                : (ObjectNode) json.putObject("meta");
 
         if (sb.length() > 0)
             meta.put("version", sb.toString());
@@ -503,8 +504,8 @@
         };
 
         // KoralQuery collection object
-        if (this.collection != null
-                && this.collection.getFilters().toArray().length > 0) {
+        if (this.collection != null) {
+            // && this.collection.getFilters().toArray().length > 0) {
             JsonNode collNode = this.collection.toJsonNode();
             if (collNode != null)
                 json.put("collection", collNode);
diff --git a/src/main/java/de/ids_mannheim/korap/response/Result.java b/src/main/java/de/ids_mannheim/korap/response/Result.java
index c120d43..bc57674 100644
--- a/src/main/java/de/ids_mannheim/korap/response/Result.java
+++ b/src/main/java/de/ids_mannheim/korap/response/Result.java
@@ -327,9 +327,8 @@
 
 
     private void _addMeta (ObjectNode json) {
-        ObjectNode meta = json.has("meta") ?
-            (ObjectNode) json.get("meta") :
-            (ObjectNode) json.putObject("meta");
+        ObjectNode meta = json.has("meta") ? (ObjectNode) json.get("meta")
+                : (ObjectNode) json.putObject("meta");
 
 
         // Relevant context setting
diff --git a/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionJSON.java b/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionJSON.java
index bb35479..41ce2dd 100644
--- a/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionJSON.java
+++ b/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionJSON.java
@@ -4,6 +4,12 @@
 import java.io.*;
 
 import de.ids_mannheim.korap.KrillCollection;
+import de.ids_mannheim.korap.Krill;
+import de.ids_mannheim.korap.KrillIndex;
+import de.ids_mannheim.korap.response.Result;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.JsonNode;
 
 import static de.ids_mannheim.korap.TestSimple.*;
 
@@ -72,6 +78,41 @@
     };
 
 
+    @Test
+    public void collectionMirror () throws Exception {
+        // Construct index
+        KrillIndex ki = new KrillIndex();
+        // Indexing test files
+        for (String i : new String[] { "00001", "00002", "00003", "00004",
+                "00005", "00006", "02439" }) {
+            ki.addDoc(
+                    getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
+                    true);
+        };
+        ki.commit();
+
+        Krill krill = new Krill(_getJSONString("collection_6.jsonld"));
+        Result kr = krill.apply(ki);
+        assertEquals(kr.getTotalResults(), 86);
+
+        ObjectMapper mapper = new ObjectMapper();
+        JsonNode res = mapper.readTree(kr.toJsonString());
+        assertTrue(res.at("/collection").isMissingNode());
+
+        krill = new Krill(_getJSONString("collection_6_withCollection.jsonld"));
+
+        kr = krill.apply(ki);
+        assertEquals(kr.getTotalResults(), 57);
+
+        res = mapper.readTree(kr.toJsonString());
+        assertFalse(res.at("/collection").isMissingNode());
+        assertEquals("koral:doc", res.at("/collection/@type").asText());
+        assertEquals("textClass", res.at("/collection/key").asText());
+        assertEquals("reisen", res.at("/collection/value").asText());
+        assertEquals("match:eq", res.at("/collection/match").asText());
+    };
+
+
     private String _getJSONString (String file) {
         return getString(getClass().getResource(path + file).getFile());
     };
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestClassFilterIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestClassFilterIndex.java
index 77ef45d..5a2565e 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestClassFilterIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestClassFilterIndex.java
@@ -20,8 +20,9 @@
     private KrillIndex ki;
     private Result kr;
 
+
     @Test
-    public void testInclude() throws IOException {
+    public void testInclude () throws IOException {
         ki = new KrillIndex();
         ki.addDoc(TestReferenceIndex.createFieldDoc0());
         ki.commit();
@@ -36,8 +37,7 @@
         SpanClassFilterQuery sq = new SpanClassFilterQuery(sdq,
                 ClassOperation.INCLUDE, 2, 1, true);
 
-        assertEquals(
-                sq.toString(),
+        assertEquals(sq.toString(),
                 "spanClassFilter(spanDistance({1: <tokens:np />}, {2: <tokens:vp />}, "
                         + "[(w[0:1], notOrdered, notExcluded)]),INCLUDE,2,1)");
 
@@ -63,7 +63,8 @@
                 "Frankenstein, treat my daughter well. She [{2:is {1:the one that "
                         + "saved your master who you hold so dear}}].", kr
                         .getMatch(2).getSnippetBrackets());
-        assertEquals("Frankenstein, treat my daughter well. She [{2:is the one that "
+        assertEquals(
+                "Frankenstein, treat my daughter well. She [{2:is the one that "
                         + "saved {1:your master} who you hold so dear}].", kr
                         .getMatch(3).getSnippetBrackets());
         assertEquals(
@@ -72,8 +73,9 @@
 
     }
 
+
     @Test
-    public void testDisjoint() throws IOException {
+    public void testDisjoint () throws IOException {
         ki = new KrillIndex();
         ki.addDoc(TestReferenceIndex.createFieldDoc0());
         ki.commit();
@@ -94,7 +96,7 @@
 
         SpanClassFilterQuery sq = new SpanClassFilterQuery(sdq,
                 ClassOperation.DISJOINT, 2, 1, true);
-        
+
         kr = ki.search(sq, (short) 10);
         // for (Match km : kr.getMatches()) {
         // System.out.println(km.getStartPos() + "," + km.getEndPos()
@@ -119,10 +121,11 @@
                 kr.getMatch(2).getSnippetBrackets());
     }
 
+
     // Problem with SpanDistanceQuery - unordered distance spans,
     // -> unsorted
     @Test
-    public void testEqual() throws IOException {
+    public void testEqual () throws IOException {
         ki = new KrillIndex();
         ki.addDoc(TestReferenceIndex.createFieldDoc0());
         ki.commit();
@@ -155,8 +158,9 @@
 
     }
 
+
     @Test
-    public void testDiffer() throws IOException {
+    public void testDiffer () throws IOException {
         ki = new KrillIndex();
         ki.addDoc(TestReferenceIndex.createFieldDoc0());
         ki.commit();
@@ -194,7 +198,7 @@
 
 
     @Test
-    public void testIntersect() throws IOException {
+    public void testIntersect () throws IOException {
         ki = new KrillIndex();
         ki.addDoc(TestReferenceIndex.createFieldDoc0());
         ki.commit();
@@ -217,13 +221,14 @@
         SpanClassFilterQuery sq = new SpanClassFilterQuery(sdq3,
                 ClassOperation.INTERSECT, 1, 2, true);
 
-        assertEquals("spanClassFilter(spanDistance({1: spanDistance(<tokens:np />, " +
-        		"{3: <tokens:vb />}, [(w[0:1], notOrdered, notExcluded)])}, " +
-        		"{2: spanDistance(<tokens:prp />, <tokens:vb />, [(w[0:1], " +
-        		"notOrdered, notExcluded)])}, [(w[0:1], notOrdered, notExcluded)]),INTERSECT,1,2)",
+        assertEquals(
+                "spanClassFilter(spanDistance({1: spanDistance(<tokens:np />, "
+                        + "{3: <tokens:vb />}, [(w[0:1], notOrdered, notExcluded)])}, "
+                        + "{2: spanDistance(<tokens:prp />, <tokens:vb />, [(w[0:1], "
+                        + "notOrdered, notExcluded)])}, [(w[0:1], notOrdered, notExcluded)]),INTERSECT,1,2)",
                 sq.toString());
-        
-        
+
+
         kr = ki.search(sq, (short) 20);
 
         // for (Match km : kr.getMatches()) {
@@ -247,7 +252,7 @@
 
 
     @Test
-    public void testMultipleSameClasses() throws IOException {
+    public void testMultipleSameClasses () throws IOException {
 
         ki = new KrillIndex();
         ki.addDoc(TestReferenceIndex.createFieldDoc0());
@@ -269,10 +274,10 @@
 
         SpanClassFilterQuery sq = new SpanClassFilterQuery(sdq2,
                 ClassOperation.INCLUDE, 2, 1, true);
-        
+
         kr = ki.search(sdq2, (short) 20);
         assertEquals(6, kr.getTotalResults());
-        
+
         // for (Match km : kr.getMatches()) {
         // System.out.println(km.getStartPos() + "," + km.getEndPos()
         // + " "
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestIndex.java
index be5fd8c..aac981e 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestIndex.java
@@ -75,6 +75,7 @@
 
     private Directory index = new RAMDirectory();
 
+
     @Test
     public void multiTerm () throws CorpusDataException {
         MultiTerm test = new MultiTerm("test");
@@ -110,6 +111,7 @@
         assertTrue(test.toString().startsWith("xip/l:\\#normal#0-5$"));
     };
 
+
     @Test
     public void multiTermToken () throws CorpusDataException {
         MultiTermToken test = new MultiTermToken("hunde", "pos:n", "m:gen:pl");
@@ -123,6 +125,7 @@
         assertEquals(test.terms.get(2).term, "m:gen:pl");
     };
 
+
     private List initIndexer () throws IOException {
         List<Map<String, String>> list = new ArrayList<>();
 
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestReferenceIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestReferenceIndex.java
index 4a56a04..f718ce3 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestReferenceIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestReferenceIndex.java
@@ -28,6 +28,7 @@
     private KrillIndex ki;
     private Result kr;
 
+
     @Test
     public void testCase1 () throws IOException {
         ki = new KrillIndex();
@@ -55,7 +56,8 @@
         // SpanSegmentQuery ssq2 = new SpanSegmentQuery(sfq2, scq3,
         // true);
 
-        SpanRelationMatchQuery rq = new SpanRelationMatchQuery(srq, sfq1, scq3, true);
+        SpanRelationMatchQuery rq = new SpanRelationMatchQuery(srq, sfq1, scq3,
+                true);
 
         // System.out.println(rq.toString());
         SpanFocusQuery sfq3 = new SpanFocusQuery(rq, (byte) 1);
@@ -85,8 +87,9 @@
         assertEquals(7, kr.getMatch(0).getEndPos());
     }
 
+
     @Test
-    public void testCase2() throws IOException, QueryException {
+    public void testCase2 () throws IOException, QueryException {
 
         String filepath = getClass().getResource(
                 "/queries/reference/distance-reference.jsonld").getFile();
@@ -97,13 +100,12 @@
         // .{0,2} #3 & #3 -> #2
 
         assertEquals(
-            "spanReference(focus(#[1,2]spanSegment(focus(#2: "
-                    + "spanSegment(spanRelation(tokens:>:stanford/d:tag), "
-                    + "focus(3: spanDistance(focus(1: spanDistance({1: <tokens:vb />}, "
-                    + "{2: <tokens:prp />}, [(w[0:1], notOrdered, notExcluded)])), "
-                    + "{3: <tokens:nn />}, [(w[0:2], notOrdered, notExcluded)])))), "
-                    + "{2: <tokens:prp />})), 2)",
-            sq.toString());
+                "spanReference(focus(#[1,2]spanSegment(focus(#2: "
+                        + "spanSegment(spanRelation(tokens:>:stanford/d:tag), "
+                        + "focus(3: spanDistance(focus(1: spanDistance({1: <tokens:vb />}, "
+                        + "{2: <tokens:prp />}, [(w[0:1], notOrdered, notExcluded)])), "
+                        + "{3: <tokens:nn />}, [(w[0:2], notOrdered, notExcluded)])))), "
+                        + "{2: <tokens:prp />})), 2)", sq.toString());
 
         SpanElementQuery seq1 = new SpanElementQuery("tokens", "vb");
         // new SpanTermQuery(new Term("tokens", "c:vb"));
@@ -174,9 +176,10 @@
         // }
     }
 
+
     // multiple references
     @Test
-    public void testCase3() throws IOException, QueryException {
+    public void testCase3 () throws IOException, QueryException {
         ki = new KrillIndex();
         ki.addDoc(createFieldDoc0());
         ki.commit();
@@ -209,17 +212,17 @@
         assertEquals(13, kr.getMatch(1).getEndPos());
     }
 
+
     // multiple document
     @Test
-    public void testCase4() throws Exception {
+    public void testCase4 () throws Exception {
         ki = new KrillIndex();
         ki.addDoc(createFieldDoc0());
         ki.addDoc(createFieldDoc1());
         ki.commit();
 
         String filepath = getClass().getResource(
-                "/queries/reference/distance-reference.jsonld")
-                .getFile();
+                "/queries/reference/distance-reference.jsonld").getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
 
@@ -231,7 +234,8 @@
         assertEquals(4, kr.getMatch(3).getEndPos());
     }
 
-    public static FieldDocument createFieldDoc1() {
+
+    public static FieldDocument createFieldDoc1 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-1");
         fd.addTV(
@@ -256,69 +260,69 @@
         return fd;
     }
 
+
     public static FieldDocument createFieldDoc0 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-0");
         fd.addTV(
                 "tokens",
                 "Frankenstein, treat my daughter well. She is the one that saved your master who you hold so dear.",
-                
+
                 "[(0-12)s:Frankenstein|_0#0-12|<>:nn#0-12$<i>1<s>18|<>:s#0-37$<i>5<s>1|"
                         + "<>:np#0-13$<i>1<s>2|"
                         + "<:stanford/d:tag$<i>1<s>1<s>18<s>19]"
 
-                + "[(14-19)s:treat|_1#14-19|<>:vb#14-19$<i>2<s>19|<>:vp#14-36$<i>5<s>3|"
+                        + "[(14-19)s:treat|_1#14-19|<>:vb#14-19$<i>2<s>19|<>:vp#14-36$<i>5<s>3|"
                         + ">:stanford/d:tag$<i>0<s>2<s>19<s>18|"
                         + ">:stanford/d:tag$<i>3<s>3<s>19<s>21|"
                         + ">:stanford/d:tag$<i>4<s>4<s>19<s>22]"
 
-                + "[(20-22)s:my|_2#20-22|<>:prp#20-22$<i>3<s>20|<>:np#20-31$<i>4<s>4]"
+                        + "[(20-22)s:my|_2#20-22|<>:prp#20-22$<i>3<s>20|<>:np#20-31$<i>4<s>4]"
 
-                + "[(23-31)s:daughter|_3#23-31|<>:nn#23-31$<i>4<s>21|"
+                        + "[(23-31)s:daughter|_3#23-31|<>:nn#23-31$<i>4<s>21|"
                         + ">:stanford/d:tag$<i>2<s>5<s>21<s>20]"
 
-                + "[(32-36)s:well|_4#32-36|<>:rb#32-36$<i>5<s>22|<>:advp#32-36$<i>5<s>5]"
+                        + "[(32-36)s:well|_4#32-36|<>:rb#32-36$<i>5<s>22|<>:advp#32-36$<i>5<s>5]"
 
-                + "[(38-41)s:She|_5#38-41|<>:prp#38-41$<i>6<s>23|<>:np#38-41$<i>6<s>36|<>:s#38-97$<i>18<s>6]"
+                        + "[(38-41)s:She|_5#38-41|<>:prp#38-41$<i>6<s>23|<>:np#38-41$<i>6<s>36|<>:s#38-97$<i>18<s>6]"
 
-                + "[(42-44)s:is|_6#42-44|<>:vb#42-44$<i>7<s>24|<>:vp#42-96$<i>18<s>7]"
+                        + "[(42-44)s:is|_6#42-44|<>:vb#42-44$<i>7<s>24|<>:vp#42-96$<i>18<s>7]"
 
-                + "[(45-48)s:the|_7#45-48|<>:dt#45-48$<i>8<s>25|<>:np#45-52$<i>9<s>8|<>:np#45-96$<i>18<s>9]"
+                        + "[(45-48)s:the|_7#45-48|<>:dt#45-48$<i>8<s>25|<>:np#45-52$<i>9<s>8|<>:np#45-96$<i>18<s>9]"
 
-                + "[(49-52)s:one|_8#49-52|<>:nn#49-52$<i>9<s>26|"
+                        + "[(49-52)s:one|_8#49-52|<>:nn#49-52$<i>9<s>26|"
                         + ">:stanford/d:tag$<i>5<s>6<s>26<s>23|"
                         + ">:stanford/d:tag$<i>6<s>7<s>26<s>24|"
                         + ">:stanford/d:tag$<i>7<s>8<s>26<s>25|"
                         + ">:stanford/d:tag$<i>10<s>9<s>26<s>28]"
-                
-                + "[(53-57)s:that|_9#53-57|<>:rp#53-57$<i>10<s>27|<>:sb#53-96$<i>18<s>10]"
-                                              
-                + "[(58-63)s:saved|_10#58-63|<>:vb#58-63$<i>11<s>28|<>:s#58-96$<i>18<s>11|"
+
+                        + "[(53-57)s:that|_9#53-57|<>:rp#53-57$<i>10<s>27|<>:sb#53-96$<i>18<s>10]"
+
+                        + "[(58-63)s:saved|_10#58-63|<>:vb#58-63$<i>11<s>28|<>:s#58-96$<i>18<s>11|"
                         + "<>:vp#58-96$<i>18<s>12|"
                         + ">:stanford/d:tag$<i>9<s>10<s>28<s>27|"
                         + ">:stanford/d:tag$<i>12<s>11<s>28<s>30|"
                         + ">:stanford/d:tag$<i>15<s>12<s>28<s>33]"
 
-                + "[(64-68)s:your|_11#64-68|<>:prp#64-68$<i>12<s>29|<>:np#64-75$<i>13<s>13]"
+                        + "[(64-68)s:your|_11#64-68|<>:prp#64-68$<i>12<s>29|<>:np#64-75$<i>13<s>13]"
 
-                + "[(69-75)s:master|_12#69-75|<>:nn#69-75$<i>13<s>30|"
+                        + "[(69-75)s:master|_12#69-75|<>:nn#69-75$<i>13<s>30|"
                         + ">:stanford/d:tag$<i>11<s>13<s>30<s>29]"
 
-                + "[(76-79)s:who|_13#76-79|<>:rp#76-79$<i>14<s>31|<>:sb#76-96$<i>18<s>14]"
+                        + "[(76-79)s:who|_13#76-79|<>:rp#76-79$<i>14<s>31|<>:sb#76-96$<i>18<s>14]"
 
-                + "[(80-83)s:you|_14#80-83|<>:prp#80-83$<i>15<s>32|<>:np#80-83$<i>15<s>37|<>:s#80-96$<i>18<s>15]"
+                        + "[(80-83)s:you|_14#80-83|<>:prp#80-83$<i>15<s>32|<>:np#80-83$<i>15<s>37|<>:s#80-96$<i>18<s>15]"
 
-                + "[(84-88)s:hold|_15#84-88|<>:vb#84-88$<i>16<s>33|<>:vp#84-96$<i>18<s>16|"
+                        + "[(84-88)s:hold|_15#84-88|<>:vb#84-88$<i>16<s>33|<>:vp#84-96$<i>18<s>16|"
                         + ">:stanford/d:tag$<i>13<s>14<s>33<s>31|"
                         + ">:stanford/d:tag$<i>14<s>15<s>33<s>32|"
                         + ">:stanford/d:tag$<i>17<s>16<s>33<s>35]"
 
-                + "[(89-91)s:so|_16#89-91|<>:rb#89-91$<i>17<s>341|<>:adjp#89-96$<i>18<s>17]"
+                        + "[(89-91)s:so|_16#89-91|<>:rb#89-91$<i>17<s>341|<>:adjp#89-96$<i>18<s>17]"
 
-                + "[(92-96)s:dear|_17#92-96|<>:jj#92-96$<i>18<s>35|"
-                        + ">:stanford/d:tag$<i>16<s>17<s>35<s>34]"
-                 );
-                        
+                        + "[(92-96)s:dear|_17#92-96|<>:jj#92-96$<i>18<s>35|"
+                        + ">:stanford/d:tag$<i>16<s>17<s>35<s>34]");
+
         return fd;
     }
 }
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestRelationIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestRelationIndex.java
index 63d2a64..8618592 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestRelationIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestRelationIndex.java
@@ -289,6 +289,7 @@
         assertEquals(4, kr.getMatch(5).getEndPos());
     }
 
+
     /**
      * Relations only with/out attribute
      * */
@@ -307,9 +308,8 @@
 
         // child-of with attr func=sbj
         SpanWithAttributeQuery wq = new SpanWithAttributeQuery(fq,
-                new SpanAttributeQuery(
-                        new SpanTermQuery(new Term("base", "r@:func=sbj")),
-                        true), true);
+                new SpanAttributeQuery(new SpanTermQuery(new Term("base",
+                        "r@:func=sbj")), true), true);
 
         kr = ki.search(wq, (short) 20);
         assertEquals((long) 1, kr.getTotalResults());
@@ -385,11 +385,12 @@
         assertEquals(7, kr.getMatch(6).getEndPos());
     }
 
+
     /**
      * Dependency relations with attribute
      * */
     @Test
-    public void testCase5() throws IOException {
+    public void testCase5 () throws IOException {
         ki.addDoc(createFieldDoc2());
         ki.commit();
 
@@ -430,6 +431,7 @@
 
     }
 
+
     /**
      * Relation with specific sources, return any targets
      * */
@@ -485,11 +487,11 @@
         ki.commit();
 
         //return source of dep relations to pos:NN
-        
+
         SpanTermWithIdQuery tq = new SpanTermWithIdQuery(new Term("base",
                 "pos:NN"), true);
-        SpanRelationQuery srq = new SpanRelationQuery(new SpanTermQuery(new Term("base",
-                "<:dep")), true);
+        SpanRelationQuery srq = new SpanRelationQuery(new SpanTermQuery(
+                new Term("base", "<:dep")), true);
         srq.setSourceClass((byte) 1);
         SpanRelationMatchQuery rm = new SpanRelationMatchQuery(srq, tq, true);
         SpanQuery rv = new SpanFocusQuery(rm, (byte) 1);
@@ -505,8 +507,7 @@
 
         // return target of dep relations from pos:NN
         srq = new SpanRelationQuery(
-                new SpanTermQuery(
-                new Term("base", ">:dep")), true);
+                new SpanTermQuery(new Term("base", ">:dep")), true);
         srq.setTargetClass((byte) 1);
         rm = new SpanRelationMatchQuery(srq, tq, true);
         rv = new SpanFocusQuery(rm, (byte) 1);
@@ -525,7 +526,8 @@
 
     /**
      * Relation with specific sources and return any targets <br/>
-     * Relation with specific sources and targets, return the targets <br/>
+     * Relation with specific sources and targets, return the targets
+     * <br/>
      * Relation with specific sources and targets, return the sources
      * 
      * @throws IOException
@@ -606,8 +608,9 @@
 
     }
 
+
     @Test
-    public void testCase10() throws IOException {
+    public void testCase10 () throws IOException {
         ki.addDoc(createFieldDoc2());
         ki.commit();
         SpanElementQuery seq1 = new SpanElementQuery("base", "np");
diff --git a/src/test/java/de/ids_mannheim/korap/query/TestKrillQueryJSON.java b/src/test/java/de/ids_mannheim/korap/query/TestKrillQueryJSON.java
index c0e1cf5..df00673 100644
--- a/src/test/java/de/ids_mannheim/korap/query/TestKrillQueryJSON.java
+++ b/src/test/java/de/ids_mannheim/korap/query/TestKrillQueryJSON.java
@@ -245,6 +245,7 @@
         assertEquals(sqwi.toQuery().toString(), "tokens:base/p:foo");
     };
 
+
     @Test
     public void queryJSONBspClass () throws QueryException {
         SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
@@ -450,46 +451,40 @@
                 "spanOverlap(<tokens:s />, spanNext(tokens:tt/p:CARD, SpanMultiTermQueryWrapper(tokens:/tt/p:N.*/)))");
     };
 
+
     @Test
     public void queryJSONflags1 () throws QueryException {
         // buchstabe/i
         SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
                 "/queries/flags/caseInsensitive.jsonld").getFile());
 
-        assertEquals(
-                sqwi.toQuery().toString(),
-                "tokens:i:buchstabe");
+        assertEquals(sqwi.toQuery().toString(), "tokens:i:buchstabe");
     };
 
+
     @Test
     public void queryJSONflags2 () throws QueryException {
         // buchstabe/i
         try {
-            String json = getString(
-                getClass().getResource(
-                    "/queries/flags/unknown1.jsonld"
-                ).getFile()
-            );
+            String json = getString(getClass().getResource(
+                    "/queries/flags/unknown1.jsonld").getFile());
             KrillQuery kq = new KrillQuery("tokens");
-            assertEquals(kq.fromJson(json).toQuery().toString(),"tokens:s:buchstabe");
-            assertEquals(kq.getWarning(0).getCode(), 748);
-            
-            json = getString(
-                getClass().getResource(
-                    "/queries/flags/unknown2.jsonld"
-                ).getFile()
-            );
-            kq = new KrillQuery("tokens");
-            assertEquals(kq.fromJson(json).toQuery().toString(),"tokens:i:buchstabe");
+            assertEquals(kq.fromJson(json).toQuery().toString(),
+                    "tokens:s:buchstabe");
             assertEquals(kq.getWarning(0).getCode(), 748);
 
-            json = getString(
-                getClass().getResource(
-                    "/queries/flags/unknown3.jsonld"
-                ).getFile()
-            );
+            json = getString(getClass().getResource(
+                    "/queries/flags/unknown2.jsonld").getFile());
             kq = new KrillQuery("tokens");
-            assertEquals(kq.fromJson(json).toQuery().toString(),"tokens:i:buchstabe");
+            assertEquals(kq.fromJson(json).toQuery().toString(),
+                    "tokens:i:buchstabe");
+            assertEquals(kq.getWarning(0).getCode(), 748);
+
+            json = getString(getClass().getResource(
+                    "/queries/flags/unknown3.jsonld").getFile());
+            kq = new KrillQuery("tokens");
+            assertEquals(kq.fromJson(json).toQuery().toString(),
+                    "tokens:i:buchstabe");
             assertEquals(kq.getWarning(0).getCode(), 748);
 
         }
@@ -498,6 +493,7 @@
         };
     };
 
+
     public static String getString (String path) {
         StringBuilder contentBuilder = new StringBuilder();
         try {
diff --git a/src/test/java/de/ids_mannheim/korap/query/TestSpanReferenceQueryJSON.java b/src/test/java/de/ids_mannheim/korap/query/TestSpanReferenceQueryJSON.java
index 57c29bc..a401916 100644
--- a/src/test/java/de/ids_mannheim/korap/query/TestSpanReferenceQueryJSON.java
+++ b/src/test/java/de/ids_mannheim/korap/query/TestSpanReferenceQueryJSON.java
@@ -14,7 +14,7 @@
 public class TestSpanReferenceQueryJSON {
 
     @Test
-    public void testFirstOperandRef() throws IOException, QueryException {
+    public void testFirstOperandRef () throws IOException, QueryException {
 
         String filepath = getClass().getResource(
                 "/queries/reference/first-operand-reference.jsonld").getFile();
@@ -30,8 +30,9 @@
                 sq.toString());
     }
 
+
     @Test
-    public void testSecondOperandRef() throws QueryException {
+    public void testSecondOperandRef () throws QueryException {
 
         String filepath = getClass().getResource(
                 "/queries/reference/second-operand-reference.jsonld").getFile();
@@ -47,8 +48,9 @@
                         + "{3: tokens:p:P}), 3)", sq.toString());
     }
 
+
     @Test
-    public void testMultipleReferences() throws QueryException {
+    public void testMultipleReferences () throws QueryException {
         String filepath = getClass().getResource(
                 "/queries/reference/multiple-references.jsonld").getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
@@ -60,55 +62,38 @@
                 "spanReference(focus(#[1,2]spanSegment(focus(#2: spanSegment(spanRelation(tokens:>:mate/d:HEAD), "
                         + "focus(2: spanReference(spanNext(focus(1: spanNext(focus(2: spanNext({1: <tokens:c:VP />}, "
                         + "{2: <tokens:c:NP />})), {3: <tokens:c:PP />})), {3: <tokens:c:PP />}), 3)))), "
-                        + "{1: <tokens:c:VP />})), 1)",
-                sq.toString());
+                        + "{1: <tokens:c:VP />})), 1)", sq.toString());
     }
 
+
     @Test
-    public void testDistanceReferences() throws QueryException {
+    public void testDistanceReferences () throws QueryException {
         String filepath = getClass().getResource(
-            "/queries/reference/bug-multiple-distance-simple.jsonld"
-        ).getFile();
+                "/queries/reference/bug-multiple-distance-simple.jsonld")
+                .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
 
-        assertEquals("spanDistance(<tokens:c:vb />, <tokens:c:prp />, [(w[1:1], notOrdered, notExcluded)])", sq.toString());
+        assertEquals(
+                "spanDistance(<tokens:c:vb />, <tokens:c:prp />, [(w[1:1], notOrdered, notExcluded)])",
+                sq.toString());
 
         // "/queries/reference/distance-reference.jsonld").getFile();
         filepath = getClass().getResource(
-            "/queries/reference/bug-multiple-distance.jsonld"
-        ).getFile();
+                "/queries/reference/bug-multiple-distance.jsonld").getFile();
         sqwi = getJSONQuery(filepath);
         sq = sqwi.toQuery();
 
         // 'cat="VP" & cat="NP" & cat="PP" & #1 . #2 & #2 . #3 & #1 .
         // #3 & #2 ->dep #1'
-        assertEquals(
-        "spanReference("+
-          "focus("+
-            "#[1,2]spanSegment("+
-              "focus("+
-                "#2: spanSegment("+
-                  "spanRelation(tokens:>:stanford/d:tag), " +
-                    "focus("+
-                      "2: spanDistance("+
-                        "focus("+
-                          "1: spanDistance("+
-                            "<tokens:c:vb />, "+
-                            "{1: <tokens:c:prp />}, " +
-                            "[(w[1:1], notOrdered, notExcluded)]"+
-                          ")"+
-                        "), "+
-                        "{2: <tokens:c:nn />}, "+
-                        "[(w[0:2], ordered, notExcluded)]"+
-                      ")"+
-                    ")"+
-                  ")"+
-                "), " +
-                "{1: <tokens:c:prp />}"+
-              ")"+
-            "), 1"+
-          ")",
-        sq.toString());
+        assertEquals("spanReference(" + "focus(" + "#[1,2]spanSegment("
+                + "focus(" + "#2: spanSegment("
+                + "spanRelation(tokens:>:stanford/d:tag), " + "focus("
+                + "2: spanDistance(" + "focus(" + "1: spanDistance("
+                + "<tokens:c:vb />, " + "{1: <tokens:c:prp />}, "
+                + "[(w[1:1], notOrdered, notExcluded)]" + ")" + "), "
+                + "{2: <tokens:c:nn />}, " + "[(w[0:2], ordered, notExcluded)]"
+                + ")" + ")" + ")" + "), " + "{1: <tokens:c:prp />}" + ")"
+                + "), 1" + ")", sq.toString());
     }
 }
diff --git a/src/test/java/de/ids_mannheim/korap/query/TestSpanRelationQueryJSON.java b/src/test/java/de/ids_mannheim/korap/query/TestSpanRelationQueryJSON.java
index fccd34a..b051509 100644
--- a/src/test/java/de/ids_mannheim/korap/query/TestSpanRelationQueryJSON.java
+++ b/src/test/java/de/ids_mannheim/korap/query/TestSpanRelationQueryJSON.java
@@ -89,6 +89,7 @@
                 sq.toString());
     }
 
+
     @Test
     public void testFocusSource () throws QueryException {
         //
@@ -101,8 +102,9 @@
                 sq.toString());
     }
 
+
     @Test
-    public void testFocusTarget() throws QueryException {
+    public void testFocusTarget () throws QueryException {
         String filepath = getClass().getResource(
                 "/queries/relation/focus-target.json").getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
@@ -113,8 +115,9 @@
                 sq.toString());
     }
 
+
     @Test
-    public void testFocusEmptyTarget() throws QueryException {
+    public void testFocusEmptyTarget () throws QueryException {
         String filepath = getClass().getResource(
                 "/queries/relation/focus-empty-target.json").getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
@@ -124,8 +127,9 @@
                 sq.toString());
     }
 
+
     @Test
-    public void testFocusEmptyBoth() throws QueryException {
+    public void testFocusEmptyBoth () throws QueryException {
         String filepath = getClass().getResource(
                 "/queries/relation/focus-empty-both.json").getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
diff --git a/src/test/java/de/ids_mannheim/korap/response/TestResponse.java b/src/test/java/de/ids_mannheim/korap/response/TestResponse.java
index 423af96..b93ddfb 100644
--- a/src/test/java/de/ids_mannheim/korap/response/TestResponse.java
+++ b/src/test/java/de/ids_mannheim/korap/response/TestResponse.java
@@ -84,6 +84,7 @@
         assertEquals("Fehler 4", respJson.at("/errors/0/1").asText());
     };
 
+
     // TODO: Skip this for the moment and refactor later
     @Ignore
     public void testResponseDeserialzation () throws IOException {
diff --git a/src/test/java/de/ids_mannheim/korap/search/TestKrill.java b/src/test/java/de/ids_mannheim/korap/search/TestKrill.java
index 8c4cd40..fd2e7c3 100644
--- a/src/test/java/de/ids_mannheim/korap/search/TestKrill.java
+++ b/src/test/java/de/ids_mannheim/korap/search/TestKrill.java
@@ -188,10 +188,12 @@
         assertEquals(kr.getTotalResults(), 1);
     };
 
+
     // Todo: There SHOULD be a failure here, but Koral currently creates empty collections
     @Test
     public void queryJSONapiTest1 () {
-        Krill test = new Krill("{\"@context\":\"http://korap.ids-mannheim.de/ns/koral/0.3/context.jsonld\",\"errors\":[],\"warnings\":[],\"messages\":[],\"collection\":{},\"query\":{\"@type\":\"koral:token\",\"wrap\":{\"@type\":\"koral:term\",\"layer\":\"orth\",\"key\":\"Baum\",\"match\":\"match:eq\"}},\"meta\":{}}");
+        Krill test = new Krill(
+                "{\"@context\":\"http://korap.ids-mannheim.de/ns/koral/0.3/context.jsonld\",\"errors\":[],\"warnings\":[],\"messages\":[],\"collection\":{},\"query\":{\"@type\":\"koral:token\",\"wrap\":{\"@type\":\"koral:term\",\"layer\":\"orth\",\"key\":\"Baum\",\"match\":\"match:eq\"}},\"meta\":{}}");
         assertFalse(test.hasErrors());
     };
 
diff --git a/src/test/java/de/ids_mannheim/korap/search/TestResult.java b/src/test/java/de/ids_mannheim/korap/search/TestResult.java
index 7425cfd..6d9a4d5 100644
--- a/src/test/java/de/ids_mannheim/korap/search/TestResult.java
+++ b/src/test/java/de/ids_mannheim/korap/search/TestResult.java
@@ -149,13 +149,13 @@
         Krill ks = new Krill(json);
         Result kr = ks.apply(ki);
         assertEquals((long) 7, kr.getTotalResults());
-        
+
         ObjectMapper mapper = new ObjectMapper();
         JsonNode res = mapper.readTree(kr.toJsonString());
 
         assertEquals(7, res.at("/meta/totalResults").asInt());
-        assertEquals("spanOr([tokens:s:a, tokens:s:b])", res.at("/meta/serialQuery")
-                .asText());
+        assertEquals("spanOr([tokens:s:a, tokens:s:b])",
+                res.at("/meta/serialQuery").asText());
         assertEquals(5, res.at("/meta/itemsPerPage").asInt());
         assertEquals(0, res.at("/meta/startIndex").asInt());
 
@@ -175,24 +175,19 @@
 
         // Query
         assertEquals("koral:group", res.at("/query/@type").asText());
-        assertEquals("operation:or", res.at("/query/operation")
-                .asText());
+        assertEquals("operation:or", res.at("/query/operation").asText());
 
-        assertEquals("koral:token", res.at("/query/operands/0/@type")
+        assertEquals("koral:token", res.at("/query/operands/0/@type").asText());
+        assertEquals("koral:term", res.at("/query/operands/0/wrap/@type")
                 .asText());
-        assertEquals("koral:term",
-                res.at("/query/operands/0/wrap/@type").asText());
-        assertEquals("orth", res.at("/query/operands/0/wrap/layer")
-                .asText());
+        assertEquals("orth", res.at("/query/operands/0/wrap/layer").asText());
         assertEquals("a", res.at("/query/operands/0/wrap/key").asText());
         assertEquals("match:eq", res.at("/query/operands/0/wrap/match")
                 .asText());
-        assertEquals("koral:token", res.at("/query/operands/1/@type")
+        assertEquals("koral:token", res.at("/query/operands/1/@type").asText());
+        assertEquals("koral:term", res.at("/query/operands/1/wrap/@type")
                 .asText());
-        assertEquals("koral:term",
-                res.at("/query/operands/1/wrap/@type").asText());
-        assertEquals("orth", res.at("/query/operands/1/wrap/layer")
-                .asText());
+        assertEquals("orth", res.at("/query/operands/1/wrap/layer").asText());
         assertEquals("b", res.at("/query/operands/1/wrap/key").asText());
         assertEquals("match:eq", res.at("/query/operands/1/wrap/match")
                 .asText());
@@ -240,8 +235,8 @@
         JsonNode res = mapper.readTree(kr.toTokenListJsonString());
 
         assertEquals(3, res.at("/meta/totalResults").asInt());
-        assertEquals("spanNext(base:s:a, base:s:b)", res.at("/meta/serialQuery")
-                .asText());
+        assertEquals("spanNext(base:s:a, base:s:b)", res
+                .at("/meta/serialQuery").asText());
         assertEquals(0, res.at("/meta/startIndex").asInt());
         assertEquals(25, res.at("/meta/itemsPerPage").asInt());
 
diff --git a/src/test/resources/queries/collections/collection_6.jsonld b/src/test/resources/queries/collections/collection_6.jsonld
new file mode 100644
index 0000000..5e60008
--- /dev/null
+++ b/src/test/resources/queries/collections/collection_6.jsonld
@@ -0,0 +1,19 @@
+{
+  "@context":"http://korap.ids-mannheim.de/ns/koral/0.3/context.jsonld",
+  "errors":[],
+  "warnings":[],
+  "messages":[],
+  "query":{
+    "@type":"koral:token",
+    "wrap":{
+      "@type":"koral:term",
+      "layer":"orth",
+      "key":"der",
+      "match":"match:eq",
+      "foundry":"opennlp"
+    }
+  },
+  "meta":{
+    "cutOff":null
+  }
+}
diff --git a/src/test/resources/queries/collections/collection_6_withCollection.jsonld b/src/test/resources/queries/collections/collection_6_withCollection.jsonld
new file mode 100644
index 0000000..91d960a
--- /dev/null
+++ b/src/test/resources/queries/collections/collection_6_withCollection.jsonld
@@ -0,0 +1,25 @@
+{
+  "@context":"http://korap.ids-mannheim.de/ns/koral/0.3/context.jsonld",
+  "errors":[],
+  "warnings":[],
+  "messages":[],
+  "collection":{
+    "@type":"koral:doc",
+    "key":"textClass",
+    "value":"reisen",
+    "match":"match:eq"
+  },
+  "query":{
+    "@type":"koral:token",
+    "wrap":{
+      "@type":"koral:term",
+      "layer":"orth",
+      "key":"der",
+      "match":"match:eq",
+      "foundry":"opennlp"
+    }
+  },
+  "meta":{
+    "cutOff":null
+  }
+}
