diff --git a/Changes b/Changes
index 8cc2db8..2747707 100644
--- a/Changes
+++ b/Changes
@@ -1,7 +1,16 @@
-0.2 2015-10-27
-        - Switch to "koral:" prefix.
+0.22 2016-06-03
+        - Spans now always wrap terms (diewald)
+	- Cosmas-II "und", "oder", and "nicht" operations
+	  now serialize to unordered sequences (diewald)
+
+0.21 2015-10-27
+        - Improved meta query builder (hanl)
+
+0.2 2015-06-25
+        - Switch to "koral:" prefix (bingel)
 	- Coverage of KoralQuery 0.3
 	  (see http://korap.github.io/Koral/)
+          (bingel)
 
 0.1 2015-02-10
-        - First version published to GitHub.
+        - First version published to GitHub (bingel)
diff --git a/pom.xml b/pom.xml
index 692be5f..00f257e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
 
   <groupId>de.ids_mannheim.korap</groupId>
   <artifactId>Koral</artifactId>
-  <version>0.21</version>
+  <version>0.22</version>
   <packaging>jar</packaging>
   <name>Koral</name>
   <url>http://maven.apache.org</url>
@@ -29,6 +29,11 @@
     </dependency>
     <dependency>
       <groupId>org.antlr</groupId>
+      <artifactId>antlr4-runtime</artifactId>
+      <version>4.5.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.antlr</groupId>
       <artifactId>antlr4-maven-plugin</artifactId>
       <version>4.2</version>
     </dependency>
@@ -75,11 +80,6 @@
       <version>1.12</version>
     </dependency>
     <dependency>
-      <groupId>org.projectlombok</groupId>
-      <artifactId>lombok</artifactId>
-      <version>0.11.8</version>
-    </dependency>
-    <dependency>
       <groupId>log4j</groupId>
       <artifactId>log4j</artifactId>
       <version>1.2.17</version>
diff --git a/src/main/antlr/poliqarpplus/PoliqarpPlusLexer.g4 b/src/main/antlr/poliqarpplus/PoliqarpPlusLexer.g4
index f8b5d91..68c0bef 100644
--- a/src/main/antlr/poliqarpplus/PoliqarpPlusLexer.g4
+++ b/src/main/antlr/poliqarpplus/PoliqarpPlusLexer.g4
@@ -60,10 +60,8 @@
 
 NL                  : [\r\n] -> skip;
 
-
 WORD                : ALPHABET+;
 
-
 /* Complex queries */
 LPAREN      : '[';
 RPAREN      : ']';
@@ -101,4 +99,5 @@
 fragment RE_expr     : ('.' | RE_char | RE_alter | RE_chgroup | RE_opt | RE_quant | RE_group)+;
 fragment RE_dquote            : '"'  (RE_expr | '\'' | ':' )* '"';
 fragment RE_squote            : '\''  (RE_expr | '\"' | ':' )* '\'';
-REGEX             : ( RE_dquote | RE_squote );
\ No newline at end of file
+ 
+REGEX             : ( RE_dquote | RE_squote | );
diff --git a/src/main/antlr/poliqarpplus/PoliqarpPlusParser.g4 b/src/main/antlr/poliqarpplus/PoliqarpPlusParser.g4
index 9e9c595..c48a3f9 100644
--- a/src/main/antlr/poliqarpplus/PoliqarpPlusParser.g4
+++ b/src/main/antlr/poliqarpplus/PoliqarpPlusParser.g4
@@ -231,4 +231,4 @@
     Entry point for all requests. Linguistic query is obligatory, metadata filtering
     is optional.
 */
-request            : query within? meta? EOF;
\ No newline at end of file
+request            : query within? meta? EOF;
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryProcessor.java b/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryProcessor.java
index e051e19..ae544a1 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryProcessor.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryProcessor.java
@@ -25,7 +25,7 @@
  * of the KoralQuery tree. See the official documentation for VC query
  * syntax
  * and functionality.
- *
+ * 
  * @author Michael Hanl (hanl@ids-mannheim.de)
  * @author Joachim Bingel (bingel@ids-mannheim.de)
  * @version 0.3.0
@@ -36,26 +36,31 @@
     private static Logger log = LoggerFactory
             .getLogger(CollectionQueryProcessor.class);
 
-    public CollectionQueryProcessor() {
+
+    public CollectionQueryProcessor () {
         KoralObjectGenerator.setQueryProcessor(this);
     }
 
-    public CollectionQueryProcessor(boolean verbose) {
+
+    public CollectionQueryProcessor (boolean verbose) {
         KoralObjectGenerator.setQueryProcessor(this);
         CollectionQueryProcessor.verbose = verbose;
     }
 
-    public CollectionQueryProcessor(String query) {
+
+    public CollectionQueryProcessor (String query) {
         KoralObjectGenerator.setQueryProcessor(this);
         process(query);
     }
 
+
     @Override
-    public void process(String query) {
+    public void process (String query) {
         ParseTree tree = parseCollectionQuery(query);
         if (this.parser != null) {
             super.parser = this.parser;
-        }else {
+        }
+        else {
             throw new NullPointerException("Parser has not been instantiated!");
         }
         log.info("Processing virtual collection query: " + query);
@@ -64,13 +69,15 @@
         if (tree != null) {
             log.debug("ANTLR parse tree: " + tree.toStringTree(parser));
             processNode(tree);
-        }else {
-            addError(StatusCodes.MALFORMED_QUERY,
-                    "Could not parse query >>> " + query + " <<<.");
+        }
+        else {
+            addError(StatusCodes.MALFORMED_QUERY, "Could not parse query >>> "
+                    + query + " <<<.");
         }
     }
 
-    private void processNode(ParseTree node) {
+
+    private void processNode (ParseTree node) {
         // Top-down processing
         String nodeCat = getNodeCat(node);
         openNodeCats.push(nodeCat);
@@ -90,8 +97,8 @@
          */
 
         if (nodeCat.equals("relation")) {
-            String operator = getNodeCat(node.getChild(1).getChild(0))
-                    .equals("&") ? "and" : "or";
+            String operator = getNodeCat(node.getChild(1).getChild(0)).equals(
+                    "&") ? "and" : "or";
             LinkedHashMap<String, Object> relationGroup = KoralObjectGenerator
                     .makeDocGroup(operator);
             putIntoSuperObject(relationGroup);
@@ -114,14 +121,14 @@
                 requestMap = new LinkedHashMap<String, Object>();
                 return;
             }
-//            if (QueryUtils.checkDateValidity(valueNode.getText())) {
-//                addWarning("The collection query contains a value that looks"
-//                        + " like a date ('" + valueNode.getText() + "') and an"
-//                        + " operator that is only defined for strings" + " ('"
-//                        + match + "'). The value is interpreted as"
-//                        + " a string. Use a date operator to ensure the value"
-//                        + " is treated as a date");
-//            }
+            //            if (QueryUtils.checkDateValidity(valueNode.getText())) {
+            //                addWarning("The collection query contains a value that looks"
+            //                        + " like a date ('" + valueNode.getText() + "') and an"
+            //                        + " operator that is only defined for strings" + " ('"
+            //                        + match + "'). The value is interpreted as"
+            //                        + " a string. Use a date operator to ensure the value"
+            //                        + " is treated as a date");
+            //            }
 
             putIntoSuperObject(term);
         }
@@ -192,7 +199,8 @@
                     }
                 }
                 token.put("wrap", term);
-            }else {
+            }
+            else {
                 // child is 'term' or 'termGroup' -> process in extra method 
                 LinkedHashMap<String, Object> termOrTermGroup = parseTermOrTermGroup(
                         node.getChild(1), negated);
@@ -231,18 +239,19 @@
 
     }
 
+
     /**
      * Checks whether the combination of operator and value is legal
      * (inequation operators <,>,<=,>= may only be used with dates).
      */
-    private boolean checkOperatorValueConformance(
+    private boolean checkOperatorValueConformance (
             LinkedHashMap<String, Object> term) {
         String match = (String) term.get("match");
         String type = (String) term.get("type");
         if (type == null || type.equals("type:regex")) {
-            if (!(match.equals("match:eq") || match.equals("match:ne") || match
-                    .equals("match:contains") || match
-                    .equals("match:containsnot"))) {
+            if (!(match.equals("match:eq") || match.equals("match:ne")
+                    || match.equals("match:contains") || match
+                        .equals("match:containsnot"))) {
                 addError(StatusCodes.INCOMPATIBLE_OPERATOR_AND_OPERAND,
                         "You used an inequation operator with a string value.");
                 return false;
@@ -251,7 +260,8 @@
         return true;
     }
 
-    private LinkedHashMap<String, Object> parseValue(ParseTree valueNode) {
+
+    private LinkedHashMap<String, Object> parseValue (ParseTree valueNode) {
         LinkedHashMap<String, Object> map = new LinkedHashMap<String, Object>();
         if (getNodeCat(valueNode).equals("date")) {
             map.put("type", "type:date");
@@ -261,6 +271,7 @@
 
         TokenStream stream = parser.getTokenStream();
         String stm = stream.getText(valueNode.getChild(0).getSourceInterval());
+        // todo: is this correct?
         if (stm.startsWith("\"") && stm.endsWith("\""))
             stm = stm.replaceAll("\"", "");
 
@@ -274,15 +285,16 @@
         return map;
     }
 
+
     /**
      * Checks if value is a date
-     *
+     * 
      * @param valueNode
      * @return
      */
 
     @Deprecated
-    private boolean checkDateValidity(ParseTree valueNode) {
+    private boolean checkDateValidity (ParseTree valueNode) {
         Pattern p = Pattern.compile("[0-9]{4}(-([0-9]{2})(-([0-9]{2}))?)?");
         Matcher m = p.matcher(valueNode.getText());
 
@@ -293,7 +305,8 @@
         if (month != null) {
             if (Integer.parseInt(month) > 12) {
                 return false;
-            }else if (day != null) {
+            }
+            else if (day != null) {
                 if (Integer.parseInt(day) > 31) {
                     return false;
                 }
@@ -302,7 +315,8 @@
         return true;
     }
 
-    private String interpretMatchOperator(String match) {
+
+    private String interpretMatchOperator (String match) {
         String out = null;
         switch (match) {
             case "<":
@@ -350,8 +364,9 @@
         return out;
     }
 
+
     @Deprecated
-    private String invertInequation(String op) {
+    private String invertInequation (String op) {
         String inv = null;
         switch (op) {
             case "lt":
@@ -370,41 +385,47 @@
         return inv;
     }
 
-    private void putIntoSuperObject(LinkedHashMap<String, Object> object) {
+
+    private void putIntoSuperObject (LinkedHashMap<String, Object> object) {
         putIntoSuperObject(object, 0);
     }
 
+
     @SuppressWarnings({ "unchecked" })
-    private void putIntoSuperObject(LinkedHashMap<String, Object> object,
+    private void putIntoSuperObject (LinkedHashMap<String, Object> object,
             int objStackPosition) {
         if (objectStack.size() > objStackPosition) {
             ArrayList<Object> topObjectOperands = (ArrayList<Object>) objectStack
                     .get(objStackPosition).get("operands");
             topObjectOperands.add(object);
-        }else {
+        }
+        else {
             //        	requestMap = object;
             requestMap.put("collection", object);
         }
     }
 
-    private LinkedHashMap<String, Object> parseTermOrTermGroup(ParseTree node,
+
+    private LinkedHashMap<String, Object> parseTermOrTermGroup (ParseTree node,
             boolean negated) {
         return parseTermOrTermGroup(node, negated, "token");
     }
 
+
     /**
      * Parses a (term) or (termGroup) node
-     *
+     * 
      * @param node
-     * @param negatedGlobal Indicates whether the term/termGroup is globally
-     *                      negated, e.g. through a negation operator preceding
-     *                      the related token
-     *                      like "![base=foo]". Global negation affects the
-     *                      "match" parameter.
+     * @param negatedGlobal
+     *            Indicates whether the term/termGroup is globally
+     *            negated, e.g. through a negation operator preceding
+     *            the related token
+     *            like "![base=foo]". Global negation affects the
+     *            "match" parameter.
      * @return A term or termGroup object, depending on input
      */
     @SuppressWarnings("unchecked")
-    private LinkedHashMap<String, Object> parseTermOrTermGroup(ParseTree node,
+    private LinkedHashMap<String, Object> parseTermOrTermGroup (ParseTree node,
             boolean negatedGlobal, String mode) {
         if (getNodeCat(node).equals("term")) {
             String key = null;
@@ -478,7 +499,8 @@
                 }
             }
             return term;
-        }else {
+        }
+        else {
             // For termGroups, establish a boolean relation between operands 
             // and recursively call this function with the term or termGroup 
             // operands.
@@ -508,7 +530,8 @@
         }
     }
 
-    private ParserRuleContext parseCollectionQuery(String query) {
+
+    private ParserRuleContext parseCollectionQuery (String query) {
         Lexer lexer = new CollectionQueryLexer((CharStream) null);
         ParserRuleContext tree = null;
         Antlr4DescriptiveErrorListener errorListener = new Antlr4DescriptiveErrorListener(
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/Cosmas2QueryProcessor.java b/src/main/java/de/ids_mannheim/korap/query/serialize/Cosmas2QueryProcessor.java
index 1b22f39..fbf63ac 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/Cosmas2QueryProcessor.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/Cosmas2QueryProcessor.java
@@ -669,6 +669,7 @@
         // Step I: create group
         LinkedHashMap<String, Object> disjunction = KoralObjectGenerator
                 .makeGroup("disjunction");
+        disjunction.put("inOrder", false); // Order is not important 
         objectStack.push(disjunction);
         stackedObjects++;
         // Step II: decide where to put
@@ -681,6 +682,7 @@
         String nodeCat = getNodeCat(node);
         LinkedHashMap<String, Object> distgroup = KoralObjectGenerator
                 .makeGroup("sequence");
+        distgroup.put("inOrder", false); // Order is not important 
         ArrayList<Object> distances = new ArrayList<Object>();
         LinkedHashMap<String, Object> zerodistance = KoralObjectGenerator
                 .makeDistance("t", 0, 0);
@@ -1350,4 +1352,4 @@
         }
         return tree;
     }
-}
\ No newline at end of file
+}
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/MetaQueryBuilder.java b/src/main/java/de/ids_mannheim/korap/query/serialize/MetaQueryBuilder.java
index f743aba..cad4319 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/MetaQueryBuilder.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/MetaQueryBuilder.java
@@ -1,7 +1,5 @@
 package de.ids_mannheim.korap.query.serialize;
 
-import lombok.Data;
-
 import java.util.LinkedHashMap;
 import java.util.LinkedList;
 import java.util.List;
@@ -19,41 +17,45 @@
     private Map meta;
     private SpanContext spanContext;
 
-    public MetaQueryBuilder() {
+
+    public MetaQueryBuilder () {
         this.meta = new LinkedHashMap();
         //        this.meta.put("fields", new LinkedList<>());
     }
 
+
     /**
      * context segment if context is either of type char or token.
      * size can differ for left and right span
-     *
+     * 
      * @param left
      * @param leftType
      * @param right
      * @param rightType
      * @return
      */
-    public MetaQueryBuilder setSpanContext(Integer left, String leftType,
+    public MetaQueryBuilder setSpanContext (Integer left, String leftType,
             Integer right, String rightType) {
         this.spanContext = new SpanContext(left, leftType, right, rightType);
         return this;
     }
 
-    public SpanContext getSpanContext() {
+
+    public SpanContext getSpanContext () {
         return this.spanContext;
     }
 
+
     /**
      * context if of type paragraph or sentence where left and right
      * size delimiters are irrelevant; or 2-token, 2-char p/paragraph,
      * s/sentence or token, char.
      * Distinguish
-     *
+     * 
      * @param context
      * @return
      */
-    public MetaQueryBuilder setSpanContext(String context) {
+    public MetaQueryBuilder setSpanContext (String context) {
         if (context != null) {
             if (!p.matcher(context).find())
                 this.spanContext = new SpanContext(context);
@@ -68,19 +70,20 @@
         return this;
     }
 
-    public MetaQueryBuilder addEntry(String name, Object value) {
+
+    public MetaQueryBuilder addEntry (String name, Object value) {
         if (value != null)
             meta.put(name, value);
         return this;
     }
 
-    public Map raw() {
+
+    public Map raw () {
         if (this.spanContext != null)
             meta.putAll(this.spanContext.raw());
         return meta;
     }
 
-    @Data
     public class SpanContext {
         private String left_type;
         private String right_type;
@@ -88,27 +91,45 @@
         private int right_size;
         private String context = null;
 
+
         /**
          * context segment if context is either of type char or token.
          * size can differ for left and right span
-         *
+         * 
          * @param ls
          * @param lt
          * @param rs
          * @param rt
          * @return
          */
-        public SpanContext(int ls, String lt, int rs, String rt) {
+        public SpanContext (int ls, String lt, int rs, String rt) {
             this.left_type = lt;
             this.left_size = ls;
             this.right_type = rt;
             this.right_size = rs;
         }
 
-        public SpanContext(String context) {
+
+        public SpanContext (String context) {
             this.context = context;
         }
 
+        public String getRightType() {
+            return this.right_type;
+        }
+
+        public String getLeftType() {
+            return this.left_type;
+        }
+
+        public Integer getLeftSize() {
+            return this.left_size;
+        }
+
+        public Integer getRightSize() {
+            return this.right_size;
+        }
+
         public Map raw() {
             Map meta = new LinkedHashMap();
             if (this.context == null) {
@@ -122,7 +143,8 @@
                 r.add(this.right_size);
                 map.put("right", r);
                 meta.put("context", map);
-            }else
+            }
+            else
                 meta.put("context", this.context);
             return meta;
         }
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessor.java b/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessor.java
index c3bd53f..03117dd 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessor.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessor.java
@@ -327,7 +327,11 @@
             // no 'term' child, but direct key specification: process here
             LinkedHashMap<String, Object> term = KoralObjectGenerator
                     .makeTerm();
+
             String key = node.getChild(0).getText();
+            TokenStream stream = parser.getTokenStream();
+            String kval = stream.getText(node.getChild(0).getSourceInterval());
+
             if (getNodeCat(node.getChild(0).getChild(0)).equals("regex")) {
                 isRegex = true;
                 term.put("type", "type:regex");
@@ -650,6 +654,7 @@
         ArrayList<Object> operands = (ArrayList<Object>) contains
                 .get("operands");
         operands.add(span);
+
         operands.add(queryObj);
         requestMap.put("query", contains);
         visited.add(node.getChild(0));
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/QuerySerializer.java b/src/main/java/de/ids_mannheim/korap/query/serialize/QuerySerializer.java
index 7f9166e..b7516fa 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/QuerySerializer.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/QuerySerializer.java
@@ -14,7 +14,7 @@
 /**
  * Main class for Koral, serializes queries from concrete QLs to
  * KoralQuery
- *
+ * 
  * @author Joachim Bingel (bingel@ids-mannheim.de),
  *         Michael Hanl (hanl@ids-mannheim.de),
  *         Eliza Margaretha (margaretha@ids-mannheim.de)
@@ -29,11 +29,10 @@
 
 
 
-
     static {
         qlProcessorAssignment = new HashMap<String, Class<? extends AbstractQueryProcessor>>();
-        qlProcessorAssignment
-                .put("poliqarpplus", PoliqarpPlusQueryProcessor.class);
+        qlProcessorAssignment.put("poliqarpplus",
+                PoliqarpPlusQueryProcessor.class);
         qlProcessorAssignment.put("cosmas2", Cosmas2QueryProcessor.class);
         qlProcessorAssignment.put("annis", AnnisQueryProcessor.class);
         qlProcessorAssignment.put("cql", CqlQueryProcessor.class);
@@ -52,16 +51,18 @@
     private org.slf4j.Logger log = LoggerFactory
             .getLogger(QuerySerializer.class);
 
-    public QuerySerializer() {
+
+    public QuerySerializer () {
         this.errors = new LinkedList<>();
         this.warnings = new LinkedList<>();
         this.messages = new LinkedList<>();
     }
 
+
     /**
      * @param args
      */
-    public static void main(String[] args) {
+    public static void main (String[] args) {
         /*
          * just for testing...
          */
@@ -74,7 +75,8 @@
             System.err
                     .println("Usage: QuerySerializer \"query\" queryLanguage");
             System.exit(1);
-        }else {
+        }
+        else {
             queries = new String[] { args[0] };
             ql = args[1];
         }
@@ -83,64 +85,86 @@
             try {
                 jg.run(q, ql);
                 System.out.println();
-            }catch (NullPointerException npe) {
+            }
+            catch (NullPointerException npe) {
                 npe.printStackTrace();
                 System.out.println("null\n");
-            }catch (IOException e) {
+            }
+            catch (IOException e) {
                 e.printStackTrace();
             }
         }
     }
 
+
     /**
      * Runs the QuerySerializer by initializing the relevant
      * AbstractSyntaxTree implementation (depending on specified query
      * language) and transforms and writes the tree's requestMap to
      * the specified output file.
-     *
-     * @param query         The query string
-     * @param queryLanguage The query language. As of 17 Dec 2014, this must be
-     *                      one of 'poliqarpplus', 'cosmas2', 'annis' or 'cql'.
+     * 
+     * @param query
+     *            The query string
+     * @param queryLanguage
+     *            The query language. As of 17 Dec 2014, this must be
+     *            one of 'poliqarpplus', 'cosmas2', 'annis' or 'cql'.
      * @throws IOException
      */
-    public void run(String query, String queryLanguage) throws IOException {
+    public void run (String query, String queryLanguage) throws IOException {
         if (queryLanguage.equalsIgnoreCase("poliqarp")) {
             ast = new PoliqarpPlusQueryProcessor(query);
-        }else if (queryLanguage.equalsIgnoreCase("cosmas2")) {
+        }
+        else if (queryLanguage.equalsIgnoreCase("cosmas2")) {
             ast = new Cosmas2QueryProcessor(query);
-        }else if (queryLanguage.equalsIgnoreCase("poliqarpplus")) {
+        }
+        else if (queryLanguage.equalsIgnoreCase("poliqarpplus")) {
             ast = new PoliqarpPlusQueryProcessor(query);
-        }else if (queryLanguage.equalsIgnoreCase("cql")) {
+        }
+        else if (queryLanguage.equalsIgnoreCase("cql")) {
             ast = new CqlQueryProcessor(query);
 		} else if (queryLanguage.equalsIgnoreCase("fcsql")) {
 			ast = new FCSQLQueryProcessor(query, "2.0");
         }else if (queryLanguage.equalsIgnoreCase("annis")) {
             ast = new AnnisQueryProcessor(query);
-        }else {
-            throw new IllegalArgumentException(
-                    queryLanguage + " is not a supported query language!");
+        }
+        else {
+            throw new IllegalArgumentException(queryLanguage
+                    + " is not a supported query language!");
         }
         toJSON();
     }
 
-    public QuerySerializer setQuery(String query, String ql, String version) {
+
+    public QuerySerializer setQuery (String query, String ql, String version) {
         ast = new DummyQueryProcessor();
         if (query == null || query.isEmpty()) {
             ast.addError(StatusCodes.NO_QUERY, "You did not specify a query!");
-        }else if (ql == null || ql.isEmpty()) {
+        }
+        else if (ql == null || ql.isEmpty()) {
             ast.addError(StatusCodes.NO_QUERY,
                     "You did not specify any query language!");
-        }else if (ql.equalsIgnoreCase("poliqarp")) {
+        }
+        else if (ql.equalsIgnoreCase("poliqarp")) {
             ast = new PoliqarpPlusQueryProcessor(query);
-        }else if (ql.equalsIgnoreCase("cosmas2")) {
+        }
+        else if (ql.equalsIgnoreCase("cosmas2")) {
             ast = new Cosmas2QueryProcessor(query);
-        }else if (ql.equalsIgnoreCase("poliqarpplus")) {
-            ast = new PoliqarpPlusQueryProcessor(query);
-        }else if (ql.equalsIgnoreCase("cql")) {
+        }
+        else if (ql.equalsIgnoreCase("poliqarpplus")) {
+            ast = new PoliqarpPlusQueryProcessor(query); 
+        }
+        else if (ql.equalsIgnoreCase("cql")) {
 			if (version == null) {
                 ast = new CqlQueryProcessor(query);
 			} else {
                 ast = new CqlQueryProcessor(query, version);
+            }
+        } else if (ql.equalsIgnoreCase("fcsql")) {
+			if (version == null) {
+				ast.addError(StatusCodes.MISSING_VERSION,
+						"SRU Version is missing!");
+			} else {
+				ast = new FCSQLQueryProcessor(query, version);
 			}
 		} else if (ql.equalsIgnoreCase("fcsql")) {
 			if (version == null) {
@@ -151,6 +175,7 @@
 			}
 		} else if (ql.equalsIgnoreCase("annis")) {
             ast = new AnnisQueryProcessor(query);
+
         }else {
 			ast.addError(StatusCodes.UNKNOWN_QUERY_LANGUAGE,
                     ql + " is not a supported query language!");
@@ -158,32 +183,38 @@
         return this;
     }
 
-    public QuerySerializer setQuery(String query, String ql) {
+
+    public QuerySerializer setQuery (String query, String ql) {
         return setQuery(query, ql, "");
     }
 
-    public void setVerbose(boolean verbose) {
+
+    public void setVerbose (boolean verbose) {
         AbstractQueryProcessor.verbose = verbose;
     }
 
-    public final String toJSON() {
+
+    public final String toJSON () {
         String ser;
         try {
             ser = mapper.writeValueAsString(raw());
             qllogger.info("Serialized query: " + ser);
-        }catch (JsonProcessingException e) {
+        }
+        catch (JsonProcessingException e) {
             return "";
         }
         return ser;
     }
 
-    public final Map build() {
+
+    public final Map build () {
         return raw();
     }
 
-    private Map raw() {
+
+    private Map raw () {
         if (ast != null) {
-            Map<String, Object> requestMap = ast.getRequestMap();
+            Map<String, Object> requestMap = new HashMap<>(ast.getRequestMap());
             Map meta = (Map) requestMap.get("meta");
             Map collection = (Map) requestMap.get("collection");
             List errors = (List) requestMap.get("errors");
@@ -191,9 +222,19 @@
             List messages = (List) requestMap.get("messages");
             collection = mergeCollection(collection, this.collection);
             requestMap.put("collection", collection);
+            
+            if (meta == null)
+                meta = new HashMap();
+            if (errors == null)
+                errors = new LinkedList();
+            if (warnings == null)
+                warnings = new LinkedList();
+            if (messages == null)
+                messages = new LinkedList();
+
             if (this.meta != null) {
-                this.meta.putAll(meta);
-                requestMap.put("meta", this.meta);
+                meta.putAll(this.meta);
+                requestMap.put("meta", meta);
             }
             if (this.errors != null && !this.errors.isEmpty()) {
                 errors.addAll(this.errors);
@@ -207,39 +248,43 @@
                 messages.addAll(this.messages);
                 requestMap.put("messages", messages);
             }
-
             return cleanup(requestMap);
         }
         return new HashMap<>();
     }
 
-    private Map<String, Object> cleanup(Map<String, Object> requestMap) {
+
+    private Map<String, Object> cleanup (Map<String, Object> requestMap) {
         Iterator<Map.Entry<String, Object>> set = requestMap.entrySet()
                 .iterator();
         while (set.hasNext()) {
             Map.Entry<String, Object> entry = set.next();
-            if (entry.getValue() instanceof List && ((List) entry.getValue())
-                    .isEmpty())
+            if (entry.getValue() instanceof List
+                    && ((List) entry.getValue()).isEmpty())
                 set.remove();
-            else if (entry.getValue() instanceof Map && ((Map) entry.getValue())
-                    .isEmpty())
+            else if (entry.getValue() instanceof Map
+                    && ((Map) entry.getValue()).isEmpty())
                 set.remove();
-            else if (entry.getValue() instanceof String && ((String) entry
-                    .getValue()).isEmpty())
+            else if (entry.getValue() instanceof String
+                    && ((String) entry.getValue()).isEmpty())
                 set.remove();
         }
         return requestMap;
     }
 
-    private Map<String, Object> mergeCollection(Map<String, Object> collection1,
-            Map<String, Object> collection2) {
+
+    private Map<String, Object> mergeCollection (
+            Map<String, Object> collection1, Map<String, Object> collection2) {
         if (collection1 == null || collection1.isEmpty()) {
             return collection2;
-        }else if (collection2 == null || collection2.isEmpty()) {
+        }
+        else if (collection2 == null || collection2.isEmpty()) {
             return collection1;
-        }else if (collection1.equals(collection2)) {
+        }
+        else if (collection1.equals(collection2)) {
             return collection1;
-        }else {
+        }
+        else {
             LinkedHashMap<String, Object> docGroup = KoralObjectGenerator
                     .makeDocGroup("and");
             ArrayList<Object> operands = (ArrayList<Object>) docGroup
@@ -250,8 +295,9 @@
         }
     }
 
+
     @Deprecated
-    public QuerySerializer addMeta(String cli, String cri, int cls, int crs,
+    public QuerySerializer addMeta (String cli, String cri, int cls, int crs,
             int num, int pageIndex) {
         MetaQueryBuilder meta = new MetaQueryBuilder();
         meta.setSpanContext(cls, cli, crs, cri);
@@ -261,17 +307,14 @@
         return this;
     }
 
-    public QuerySerializer setMeta(Map<String, Object> meta) {
+
+    public QuerySerializer setMeta (Map<String, Object> meta) {
         this.meta = meta;
         return this;
     }
 
-    public QuerySerializer setMeta(MetaQueryBuilder meta) {
-        this.meta = meta.raw();
-        return this;
-    }
 
-    public QuerySerializer setCollection(String collection) {
+    public QuerySerializer setCollection (String collection) {
         CollectionQueryProcessor tree = new CollectionQueryProcessor();
         tree.process(collection);
         Map<String, Object> collectionRequest = tree.getRequestMap();
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/QueryUtils.java b/src/main/java/de/ids_mannheim/korap/query/serialize/QueryUtils.java
index 6980b2e..47b5e09 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/QueryUtils.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/QueryUtils.java
@@ -14,7 +14,7 @@
  */
 public class QueryUtils {
 
-    public static SimpleEntry<String, Integer> checkUnbalancedPars(String q) {
+    public static SimpleEntry<String, Integer> checkUnbalancedPars (String q) {
         Map<Character, Character> brackets = new HashMap<Character, Character>();
         brackets.put('[', ']');
         brackets.put('{', '}');
@@ -31,8 +31,9 @@
             if (brackets.containsKey(q.charAt(i))) {
                 stack.push(q.charAt(i));
                 lastOpenBracket = i;
-            }else if (stack.empty() || (q.charAt(i) != brackets
-                    .get(stack.pop()))) {
+            }
+            else if (stack.empty()
+                    || (q.charAt(i) != brackets.get(stack.pop()))) {
                 return new SimpleEntry<String, Integer>(
                         "Parantheses/brackets unbalanced.", i);
             }
@@ -43,13 +44,15 @@
         return null;
     }
 
-    public static List<String> parseMorph(String stringTree) {
+
+    public static List<String> parseMorph (String stringTree) {
 
         ArrayList<String> morph = new ArrayList<String>();
         return morph;
     }
 
-    public static String buildCypherQuery(String cypher, String ctypel,
+
+    public static String buildCypherQuery (String cypher, String ctypel,
             String ctyper, int cl, int cr, int page, int limit) {
         // todo: implies that there is only one type allowed!
         String sctypel = "", sctyper = "";
@@ -100,7 +103,8 @@
         return buffer.toString();
     }
 
-    public static String buildDotQuery(long sid, String graphdb_id) {
+
+    public static String buildDotQuery (long sid, String graphdb_id) {
         StringBuffer b = new StringBuffer();
         b.append("<query>");
         b.append("<sentenceId>");
@@ -122,7 +126,8 @@
         return b.toString();
     }
 
-    public String buildaggreQuery(String query) {
+
+    public String buildaggreQuery (String query) {
         StringBuffer b = new StringBuffer();
         b.append("<query><cypher><![CDATA[");
         b.append(query);
@@ -151,9 +156,10 @@
         return b.toString();
     }
 
+
     @Deprecated
-    public static Map addParameters(Map request, int page, int num, String cli,
-            String cri, int cls, int crs, boolean cutoff) {
+    public static Map addParameters (Map request, int page, int num,
+            String cli, String cri, int cls, int crs, boolean cutoff) {
         Map ctx = new LinkedHashMap();
         List left = new ArrayList();
         left.add(cli);
@@ -172,14 +178,15 @@
         return request;
     }
 
+
     /**
      * Checks if value is a date
-     *
+     * 
      * @param value
      * @return
      */
 
-    public static boolean checkDateValidity(String value) {
+    public static boolean checkDateValidity (String value) {
         Pattern p = Pattern.compile("^[0-9]{4}(-([0-9]{2})(-([0-9]{2}))?)?$");
         Matcher m = p.matcher(value);
 
@@ -190,7 +197,8 @@
         if (month != null) {
             if (Integer.parseInt(month) > 12) {
                 return false;
-            }else if (day != null) {
+            }
+            else if (day != null) {
                 if (Integer.parseInt(day) > 31) {
                     return false;
                 }
@@ -199,7 +207,8 @@
         return true;
     }
 
-    public static String escapeRegexSpecialChars(String key) {
+
+    public static String escapeRegexSpecialChars (String key) {
         key.replace("\\", "\\\\");
         Pattern p = Pattern
                 .compile("\\.|\\^|\\$|\\||\\?|\\*|\\+|\\(|\\)|\\[|\\]|\\{|\\}");
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/util/KoralObjectGenerator.java b/src/main/java/de/ids_mannheim/korap/query/serialize/util/KoralObjectGenerator.java
index 20de50c..8381176 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/util/KoralObjectGenerator.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/util/KoralObjectGenerator.java
@@ -27,7 +27,9 @@
     public static LinkedHashMap<String, Object> makeSpan (String key) {
         LinkedHashMap<String, Object> span = new LinkedHashMap<String, Object>();
         span.put("@type", "koral:span");
-        span.put("key", key);
+        LinkedHashMap<String, Object> term = makeTerm();
+        term.put("key", key);
+        span.put("wrap", term);
         return span;
     }
 
@@ -334,4 +336,4 @@
         }
         return number;
     }
-}
\ No newline at end of file
+}
diff --git a/src/test/java/de/ids_mannheim/korap/query/serialize/CollectionQueryDuplicateTest.java b/src/test/java/de/ids_mannheim/korap/query/serialize/CollectionQueryDuplicateTest.java
index d3c1faa..f7c4dd1 100644
--- a/src/test/java/de/ids_mannheim/korap/query/serialize/CollectionQueryDuplicateTest.java
+++ b/src/test/java/de/ids_mannheim/korap/query/serialize/CollectionQueryDuplicateTest.java
@@ -2,10 +2,14 @@
 
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import org.junit.Assert;
 import org.junit.Test;
 
 import java.io.IOException;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
 /**
  * @author hanl
  * @date 28/07/2015
@@ -13,20 +17,20 @@
 public class CollectionQueryDuplicateTest {
 
     @Test
-    public void testCollectionQueryDuplicateThrowsAssertionException() {
+    public void testCollectionQueryDuplicateThrowsAssertionException ()
+            throws IOException {
         QuerySerializer serializer = new QuerySerializer();
         serializer.setQuery("[base=Haus]", "poliqarp");
         serializer.setCollection("textClass=politik & corpusID=WPD");
         ObjectMapper m = new ObjectMapper();
-        try {
-            JsonNode first = m.readTree(serializer.toJSON());
-            JsonNode second = m.readTree(serializer.toJSON());
-
-            assert first.at("/collection").equals(second.at("/collection"));
-
-        }catch (IOException e) {
-            e.printStackTrace();
-        }
+        JsonNode first = m.readTree(serializer.toJSON());
+        assertNotNull(first);
+        assertEquals(first.at("/collection"), m.readTree(serializer.toJSON())
+                .at("/collection"));
+        assertEquals(first.at("/collection"), m.readTree(serializer.toJSON())
+                .at("/collection"));
+        assertEquals(first.at("/collection"), m.readTree(serializer.toJSON())
+                .at("/collection"));
     }
 
 }
diff --git a/src/test/java/de/ids_mannheim/korap/query/serialize/CollectionQueryProcessorTest.java b/src/test/java/de/ids_mannheim/korap/query/serialize/CollectionQueryProcessorTest.java
index 1a24352..0e91058 100644
--- a/src/test/java/de/ids_mannheim/korap/query/serialize/CollectionQueryProcessorTest.java
+++ b/src/test/java/de/ids_mannheim/korap/query/serialize/CollectionQueryProcessorTest.java
@@ -22,8 +22,9 @@
     ObjectMapper mapper = new ObjectMapper();
     JsonNode res;
 
+
     @Test
-    public void testContext() throws JsonProcessingException, IOException {
+    public void testContext () throws JsonProcessingException, IOException {
         collection = "textClass=politik";
         String contextString = "http://korap.ids-mannheim.de/ns/koral/0.3/context.jsonld";
         qs.setQuery(query, ql);
@@ -32,8 +33,9 @@
         assertEquals(contextString, res.get("@context").asText());
     }
 
+
     @Test
-    public void testSimple() throws JsonProcessingException, IOException {
+    public void testSimple () throws JsonProcessingException, IOException {
         collection = "textClass=politik";
         qs.setQuery(query, ql);
         qs.setCollection(collection);
@@ -53,9 +55,10 @@
         assertEquals("match:ne", res.at("/collection/match").asText());
     }
 
+
     @Test
-    public void testSpecialCharacters()
-            throws JsonProcessingException, IOException {
+    public void testSpecialCharacters () throws JsonProcessingException,
+            IOException {
         collection = "[base/n=alt]";
         qs.setQuery(query, ql);
         qs.setCollection(collection);
@@ -71,8 +74,9 @@
 
     ;
 
+
     @Test
-    public void testContains() throws JsonProcessingException, IOException {
+    public void testContains () throws JsonProcessingException, IOException {
         collection = "title~Mannheim";
         qs.setQuery(query, ql);
         qs.setCollection(collection);
@@ -101,8 +105,9 @@
         assertEquals("match:contains", res.at("/collection/match").asText());
     }
 
+
     @Test
-    public void testNotDate() throws JsonProcessingException, IOException {
+    public void testNotDate () throws JsonProcessingException, IOException {
         collection = "author=\"firefighter1974\"";
         qs.setQuery(query, ql);
         qs.setCollection(collection);
@@ -115,29 +120,29 @@
         assertEquals("", res.at("/warnings/0/0").asText());
     }
 
+
     @Test
-    public void testTwoConjuncts() throws JsonProcessingException, IOException {
+    public void testTwoConjuncts () throws JsonProcessingException, IOException {
         collection = "textClass=Sport & pubDate in 2014";
         qs.setQuery(query, ql);
         qs.setCollection(collection);
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:docGroup", res.at("/collection/@type").asText());
         assertEquals("operation:and", res.at("/collection/operation").asText());
-        assertEquals("koral:doc",
-                res.at("/collection/operands/0/@type").asText());
-        assertEquals("textClass",
-                res.at("/collection/operands/0/key").asText());
+        assertEquals("koral:doc", res.at("/collection/operands/0/@type")
+                .asText());
+        assertEquals("textClass", res.at("/collection/operands/0/key").asText());
         assertEquals("Sport", res.at("/collection/operands/0/value").asText());
-        assertEquals("match:eq",
-                res.at("/collection/operands/0/match").asText());
-        assertEquals("koral:doc",
-                res.at("/collection/operands/1/@type").asText());
+        assertEquals("match:eq", res.at("/collection/operands/0/match")
+                .asText());
+        assertEquals("koral:doc", res.at("/collection/operands/1/@type")
+                .asText());
         assertEquals("pubDate", res.at("/collection/operands/1/key").asText());
         assertEquals("2014", res.at("/collection/operands/1/value").asText());
-        assertEquals("type:date",
-                res.at("/collection/operands/1/type").asText());
-        assertEquals("match:eq",
-                res.at("/collection/operands/1/match").asText());
+        assertEquals("type:date", res.at("/collection/operands/1/type")
+                .asText());
+        assertEquals("match:eq", res.at("/collection/operands/1/match")
+                .asText());
 
         collection = "textClass=Sport & pubDate=2014";
         qs.setQuery(query, ql);
@@ -146,166 +151,165 @@
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:docGroup", res.at("/collection/@type").asText());
         assertEquals("operation:and", res.at("/collection/operation").asText());
-        assertEquals("koral:doc",
-                res.at("/collection/operands/0/@type").asText());
-        assertEquals("textClass",
-                res.at("/collection/operands/0/key").asText());
+        assertEquals("koral:doc", res.at("/collection/operands/0/@type")
+                .asText());
+        assertEquals("textClass", res.at("/collection/operands/0/key").asText());
         assertEquals("Sport", res.at("/collection/operands/0/value").asText());
-        assertEquals("match:eq",
-                res.at("/collection/operands/0/match").asText());
-        assertEquals("koral:doc",
-                res.at("/collection/operands/1/@type").asText());
+        assertEquals("match:eq", res.at("/collection/operands/0/match")
+                .asText());
+        assertEquals("koral:doc", res.at("/collection/operands/1/@type")
+                .asText());
         assertEquals("pubDate", res.at("/collection/operands/1/key").asText());
         assertEquals("2014", res.at("/collection/operands/1/value").asText());
-        assertEquals(true,
-                res.at("/collection/operands/1/type").isMissingNode());
-        assertEquals("match:eq",
-                res.at("/collection/operands/1/match").asText());
+        assertEquals(true, res.at("/collection/operands/1/type")
+                .isMissingNode());
+        assertEquals("match:eq", res.at("/collection/operands/1/match")
+                .asText());
         assertTrue(res.at("/warnings/0").isMissingNode());
         //        assertTrue(res.at("/warnings/0/0").asText().startsWith(
         //                "The collection query contains a value that looks like a date"));
     }
 
+
     @Test
-    public void testThreeConjuncts()
-            throws JsonProcessingException, IOException {
+    public void testThreeConjuncts () throws JsonProcessingException,
+            IOException {
         collection = "textClass=Sport & pubDate in 2014 & corpusId=WPD";
         qs.setQuery(query, ql);
         qs.setCollection(collection);
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:docGroup", res.at("/collection/@type").asText());
         assertEquals("operation:and", res.at("/collection/operation").asText());
-        assertEquals("koral:doc",
-                res.at("/collection/operands/0/@type").asText());
-        assertEquals("textClass",
-                res.at("/collection/operands/0/key").asText());
+        assertEquals("koral:doc", res.at("/collection/operands/0/@type")
+                .asText());
+        assertEquals("textClass", res.at("/collection/operands/0/key").asText());
         assertEquals("Sport", res.at("/collection/operands/0/value").asText());
-        assertEquals("match:eq",
-                res.at("/collection/operands/0/match").asText());
-        assertEquals("koral:docGroup",
-                res.at("/collection/operands/1/@type").asText());
-        assertEquals("operation:and",
-                res.at("/collection/operands/1/operation").asText());
+        assertEquals("match:eq", res.at("/collection/operands/0/match")
+                .asText());
+        assertEquals("koral:docGroup", res.at("/collection/operands/1/@type")
+                .asText());
+        assertEquals("operation:and", res
+                .at("/collection/operands/1/operation").asText());
         assertEquals("koral:doc",
                 res.at("/collection/operands/1/operands/0/@type").asText());
-        assertEquals("pubDate",
-                res.at("/collection/operands/1/operands/0/key").asText());
-        assertEquals("2014",
-                res.at("/collection/operands/1/operands/0/value").asText());
+        assertEquals("pubDate", res.at("/collection/operands/1/operands/0/key")
+                .asText());
+        assertEquals("2014", res.at("/collection/operands/1/operands/0/value")
+                .asText());
         assertEquals("type:date",
                 res.at("/collection/operands/1/operands/0/type").asText());
         assertEquals("match:eq",
                 res.at("/collection/operands/1/operands/0/match").asText());
         assertEquals("koral:doc",
                 res.at("/collection/operands/1/operands/1/@type").asText());
-        assertEquals("corpusId",
-                res.at("/collection/operands/1/operands/1/key").asText());
-        assertEquals("WPD",
-                res.at("/collection/operands/1/operands/1/value").asText());
+        assertEquals("corpusId", res
+                .at("/collection/operands/1/operands/1/key").asText());
+        assertEquals("WPD", res.at("/collection/operands/1/operands/1/value")
+                .asText());
         assertEquals("match:eq",
                 res.at("/collection/operands/1/operands/1/match").asText());
     }
 
+
     @Test
-    public void testTwoDisjuncts() throws JsonProcessingException, IOException {
+    public void testTwoDisjuncts () throws JsonProcessingException, IOException {
         collection = "textClass=Sport | pubDate in 2014";
         qs.setQuery(query, ql);
         qs.setCollection(collection);
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:docGroup", res.at("/collection/@type").asText());
         assertEquals("operation:or", res.at("/collection/operation").asText());
-        assertEquals("koral:doc",
-                res.at("/collection/operands/0/@type").asText());
-        assertEquals("textClass",
-                res.at("/collection/operands/0/key").asText());
+        assertEquals("koral:doc", res.at("/collection/operands/0/@type")
+                .asText());
+        assertEquals("textClass", res.at("/collection/operands/0/key").asText());
         assertEquals("Sport", res.at("/collection/operands/0/value").asText());
-        assertEquals("match:eq",
-                res.at("/collection/operands/0/match").asText());
-        assertEquals("koral:doc",
-                res.at("/collection/operands/1/@type").asText());
+        assertEquals("match:eq", res.at("/collection/operands/0/match")
+                .asText());
+        assertEquals("koral:doc", res.at("/collection/operands/1/@type")
+                .asText());
         assertEquals("pubDate", res.at("/collection/operands/1/key").asText());
         assertEquals("2014", res.at("/collection/operands/1/value").asText());
-        assertEquals("type:date",
-                res.at("/collection/operands/1/type").asText());
-        assertEquals("match:eq",
-                res.at("/collection/operands/1/match").asText());
+        assertEquals("type:date", res.at("/collection/operands/1/type")
+                .asText());
+        assertEquals("match:eq", res.at("/collection/operands/1/match")
+                .asText());
     }
 
+
     @Test
-    public void testThreeDisjuncts()
-            throws JsonProcessingException, IOException {
+    public void testThreeDisjuncts () throws JsonProcessingException,
+            IOException {
         collection = "textClass=Sport | pubDate in 2014 | corpusId=WPD";
         qs.setQuery(query, ql);
         qs.setCollection(collection);
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:docGroup", res.at("/collection/@type").asText());
         assertEquals("operation:or", res.at("/collection/operation").asText());
-        assertEquals("koral:doc",
-                res.at("/collection/operands/0/@type").asText());
-        assertEquals("textClass",
-                res.at("/collection/operands/0/key").asText());
+        assertEquals("koral:doc", res.at("/collection/operands/0/@type")
+                .asText());
+        assertEquals("textClass", res.at("/collection/operands/0/key").asText());
         assertEquals("Sport", res.at("/collection/operands/0/value").asText());
-        assertEquals("match:eq",
-                res.at("/collection/operands/0/match").asText());
-        assertEquals("koral:docGroup",
-                res.at("/collection/operands/1/@type").asText());
-        assertEquals("operation:or",
-                res.at("/collection/operands/1/operation").asText());
+        assertEquals("match:eq", res.at("/collection/operands/0/match")
+                .asText());
+        assertEquals("koral:docGroup", res.at("/collection/operands/1/@type")
+                .asText());
+        assertEquals("operation:or", res.at("/collection/operands/1/operation")
+                .asText());
         assertEquals("koral:doc",
                 res.at("/collection/operands/1/operands/0/@type").asText());
-        assertEquals("pubDate",
-                res.at("/collection/operands/1/operands/0/key").asText());
-        assertEquals("2014",
-                res.at("/collection/operands/1/operands/0/value").asText());
+        assertEquals("pubDate", res.at("/collection/operands/1/operands/0/key")
+                .asText());
+        assertEquals("2014", res.at("/collection/operands/1/operands/0/value")
+                .asText());
         assertEquals("type:date",
                 res.at("/collection/operands/1/operands/0/type").asText());
         assertEquals("match:eq",
                 res.at("/collection/operands/1/operands/0/match").asText());
         assertEquals("koral:doc",
                 res.at("/collection/operands/1/operands/1/@type").asText());
-        assertEquals("corpusId",
-                res.at("/collection/operands/1/operands/1/key").asText());
-        assertEquals("WPD",
-                res.at("/collection/operands/1/operands/1/value").asText());
+        assertEquals("corpusId", res
+                .at("/collection/operands/1/operands/1/key").asText());
+        assertEquals("WPD", res.at("/collection/operands/1/operands/1/value")
+                .asText());
         assertEquals("match:eq",
                 res.at("/collection/operands/1/operands/1/match").asText());
     }
 
+
     @Test
-    public void testMixed() throws JsonProcessingException, IOException {
+    public void testMixed () throws JsonProcessingException, IOException {
         collection = "textClass=Sport | (pubDate in 2014 & corpusId=WPD)";
         qs.setQuery(query, ql);
         qs.setCollection(collection);
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:docGroup", res.at("/collection/@type").asText());
         assertEquals("operation:or", res.at("/collection/operation").asText());
-        assertEquals("koral:doc",
-                res.at("/collection/operands/0/@type").asText());
-        assertEquals("textClass",
-                res.at("/collection/operands/0/key").asText());
+        assertEquals("koral:doc", res.at("/collection/operands/0/@type")
+                .asText());
+        assertEquals("textClass", res.at("/collection/operands/0/key").asText());
         assertEquals("Sport", res.at("/collection/operands/0/value").asText());
-        assertEquals("match:eq",
-                res.at("/collection/operands/0/match").asText());
-        assertEquals("koral:docGroup",
-                res.at("/collection/operands/1/@type").asText());
-        assertEquals("operation:and",
-                res.at("/collection/operands/1/operation").asText());
+        assertEquals("match:eq", res.at("/collection/operands/0/match")
+                .asText());
+        assertEquals("koral:docGroup", res.at("/collection/operands/1/@type")
+                .asText());
+        assertEquals("operation:and", res
+                .at("/collection/operands/1/operation").asText());
         assertEquals("koral:doc",
                 res.at("/collection/operands/1/operands/0/@type").asText());
-        assertEquals("pubDate",
-                res.at("/collection/operands/1/operands/0/key").asText());
-        assertEquals("2014",
-                res.at("/collection/operands/1/operands/0/value").asText());
+        assertEquals("pubDate", res.at("/collection/operands/1/operands/0/key")
+                .asText());
+        assertEquals("2014", res.at("/collection/operands/1/operands/0/value")
+                .asText());
         assertEquals("type:date",
                 res.at("/collection/operands/1/operands/0/type").asText());
         assertEquals("match:eq",
                 res.at("/collection/operands/1/operands/0/match").asText());
         assertEquals("koral:doc",
                 res.at("/collection/operands/1/operands/1/@type").asText());
-        assertEquals("corpusId",
-                res.at("/collection/operands/1/operands/1/key").asText());
-        assertEquals("WPD",
-                res.at("/collection/operands/1/operands/1/value").asText());
+        assertEquals("corpusId", res
+                .at("/collection/operands/1/operands/1/key").asText());
+        assertEquals("WPD", res.at("/collection/operands/1/operands/1/value")
+                .asText());
         assertEquals("match:eq",
                 res.at("/collection/operands/1/operands/1/match").asText());
 
@@ -315,33 +319,32 @@
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:docGroup", res.at("/collection/@type").asText());
         assertEquals("operation:or", res.at("/collection/operation").asText());
-        assertEquals("koral:doc",
-                res.at("/collection/operands/0/@type").asText());
-        assertEquals("textClass",
-                res.at("/collection/operands/0/key").asText());
+        assertEquals("koral:doc", res.at("/collection/operands/0/@type")
+                .asText());
+        assertEquals("textClass", res.at("/collection/operands/0/key").asText());
         assertEquals("Sport", res.at("/collection/operands/0/value").asText());
-        assertEquals("match:eq",
-                res.at("/collection/operands/0/match").asText());
-        assertEquals("koral:docGroup",
-                res.at("/collection/operands/1/@type").asText());
-        assertEquals("operation:and",
-                res.at("/collection/operands/1/operation").asText());
+        assertEquals("match:eq", res.at("/collection/operands/0/match")
+                .asText());
+        assertEquals("koral:docGroup", res.at("/collection/operands/1/@type")
+                .asText());
+        assertEquals("operation:and", res
+                .at("/collection/operands/1/operation").asText());
         assertEquals("koral:doc",
                 res.at("/collection/operands/1/operands/0/@type").asText());
-        assertEquals("pubDate",
-                res.at("/collection/operands/1/operands/0/key").asText());
-        assertEquals("2014",
-                res.at("/collection/operands/1/operands/0/value").asText());
+        assertEquals("pubDate", res.at("/collection/operands/1/operands/0/key")
+                .asText());
+        assertEquals("2014", res.at("/collection/operands/1/operands/0/value")
+                .asText());
         assertEquals("type:date",
                 res.at("/collection/operands/1/operands/0/type").asText());
         assertEquals("match:eq",
                 res.at("/collection/operands/1/operands/0/match").asText());
         assertEquals("koral:doc",
                 res.at("/collection/operands/1/operands/1/@type").asText());
-        assertEquals("corpusId",
-                res.at("/collection/operands/1/operands/1/key").asText());
-        assertEquals("WPD",
-                res.at("/collection/operands/1/operands/1/value").asText());
+        assertEquals("corpusId", res
+                .at("/collection/operands/1/operands/1/key").asText());
+        assertEquals("WPD", res.at("/collection/operands/1/operands/1/value")
+                .asText());
         assertEquals("match:eq",
                 res.at("/collection/operands/1/operands/1/match").asText());
 
@@ -351,16 +354,16 @@
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:docGroup", res.at("/collection/@type").asText());
         assertEquals("operation:and", res.at("/collection/operation").asText());
-        assertEquals("koral:docGroup",
-                res.at("/collection/operands/0/@type").asText());
-        assertEquals("operation:or",
-                res.at("/collection/operands/0/operation").asText());
+        assertEquals("koral:docGroup", res.at("/collection/operands/0/@type")
+                .asText());
+        assertEquals("operation:or", res.at("/collection/operands/0/operation")
+                .asText());
         assertEquals("koral:doc",
                 res.at("/collection/operands/0/operands/0/@type").asText());
         assertEquals("koral:doc",
                 res.at("/collection/operands/0/operands/1/@type").asText());
-        assertEquals("koral:doc",
-                res.at("/collection/operands/1/@type").asText());
+        assertEquals("koral:doc", res.at("/collection/operands/1/@type")
+                .asText());
 
         collection = "(textClass=Sport & pubDate in 2014) & corpusId=WPD";
         qs.setQuery(query, ql);
@@ -368,16 +371,16 @@
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:docGroup", res.at("/collection/@type").asText());
         assertEquals("operation:and", res.at("/collection/operation").asText());
-        assertEquals("koral:docGroup",
-                res.at("/collection/operands/0/@type").asText());
-        assertEquals("operation:and",
-                res.at("/collection/operands/0/operation").asText());
+        assertEquals("koral:docGroup", res.at("/collection/operands/0/@type")
+                .asText());
+        assertEquals("operation:and", res
+                .at("/collection/operands/0/operation").asText());
         assertEquals("koral:doc",
                 res.at("/collection/operands/0/operands/0/@type").asText());
         assertEquals("koral:doc",
                 res.at("/collection/operands/0/operands/1/@type").asText());
-        assertEquals("koral:doc",
-                res.at("/collection/operands/1/@type").asText());
+        assertEquals("koral:doc", res.at("/collection/operands/1/@type")
+                .asText());
 
         collection = "(textClass=Sport & textClass=ausland) | (corpusID=WPD & author=White)";
         qs.setQuery(query, ql);
@@ -385,30 +388,30 @@
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:docGroup", res.at("/collection/@type").asText());
         assertEquals("operation:or", res.at("/collection/operation").asText());
-        assertEquals("koral:docGroup",
-                res.at("/collection/operands/0/@type").asText());
-        assertEquals("operation:and",
-                res.at("/collection/operands/0/operation").asText());
-        assertEquals("koral:docGroup",
-                res.at("/collection/operands/1/@type").asText());
-        assertEquals("operation:and",
-                res.at("/collection/operands/1/operation").asText());
+        assertEquals("koral:docGroup", res.at("/collection/operands/0/@type")
+                .asText());
+        assertEquals("operation:and", res
+                .at("/collection/operands/0/operation").asText());
+        assertEquals("koral:docGroup", res.at("/collection/operands/1/@type")
+                .asText());
+        assertEquals("operation:and", res
+                .at("/collection/operands/1/operation").asText());
         assertEquals("koral:doc",
                 res.at("/collection/operands/0/operands/0/@type").asText());
-        assertEquals("Sport",
-                res.at("/collection/operands/0/operands/0/value").asText());
+        assertEquals("Sport", res.at("/collection/operands/0/operands/0/value")
+                .asText());
         assertEquals("koral:doc",
                 res.at("/collection/operands/0/operands/1/@type").asText());
         assertEquals("ausland",
                 res.at("/collection/operands/0/operands/1/value").asText());
         assertEquals("koral:doc",
                 res.at("/collection/operands/1/operands/0/@type").asText());
-        assertEquals("WPD",
-                res.at("/collection/operands/1/operands/0/value").asText());
+        assertEquals("WPD", res.at("/collection/operands/1/operands/0/value")
+                .asText());
         assertEquals("koral:doc",
                 res.at("/collection/operands/1/operands/1/@type").asText());
-        assertEquals("White",
-                res.at("/collection/operands/1/operands/1/value").asText());
+        assertEquals("White", res.at("/collection/operands/1/operands/1/value")
+                .asText());
 
         collection = "(textClass=Sport & textClass=ausland) | (corpusID=WPD & author=White & pubDate in 2000)";
         qs.setQuery(query, ql);
@@ -416,26 +419,26 @@
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:docGroup", res.at("/collection/@type").asText());
         assertEquals("operation:or", res.at("/collection/operation").asText());
-        assertEquals("koral:docGroup",
-                res.at("/collection/operands/0/@type").asText());
-        assertEquals("operation:and",
-                res.at("/collection/operands/0/operation").asText());
-        assertEquals("koral:docGroup",
-                res.at("/collection/operands/1/@type").asText());
-        assertEquals("operation:and",
-                res.at("/collection/operands/1/operation").asText());
+        assertEquals("koral:docGroup", res.at("/collection/operands/0/@type")
+                .asText());
+        assertEquals("operation:and", res
+                .at("/collection/operands/0/operation").asText());
+        assertEquals("koral:docGroup", res.at("/collection/operands/1/@type")
+                .asText());
+        assertEquals("operation:and", res
+                .at("/collection/operands/1/operation").asText());
         assertEquals("koral:doc",
                 res.at("/collection/operands/0/operands/0/@type").asText());
-        assertEquals("Sport",
-                res.at("/collection/operands/0/operands/0/value").asText());
+        assertEquals("Sport", res.at("/collection/operands/0/operands/0/value")
+                .asText());
         assertEquals("koral:doc",
                 res.at("/collection/operands/0/operands/1/@type").asText());
         assertEquals("ausland",
                 res.at("/collection/operands/0/operands/1/value").asText());
         assertEquals("koral:doc",
                 res.at("/collection/operands/1/operands/0/@type").asText());
-        assertEquals("WPD",
-                res.at("/collection/operands/1/operands/0/value").asText());
+        assertEquals("WPD", res.at("/collection/operands/1/operands/0/value")
+                .asText());
         assertEquals("koral:docGroup",
                 res.at("/collection/operands/1/operands/1/@type").asText());
         assertEquals("operation:and",
@@ -448,8 +451,9 @@
                         .asText());
     }
 
+
     @Test
-    public void testDateYear() throws JsonProcessingException, IOException {
+    public void testDateYear () throws JsonProcessingException, IOException {
         collection = "pubDate in 2000";
         qs.setQuery(query, ql);
         qs.setCollection(collection);
@@ -491,8 +495,9 @@
         assertEquals("match:leq", res.at("/collection/match").asText());
     }
 
+
     @Test
-    public void testDateMonthDay() throws JsonProcessingException, IOException {
+    public void testDateMonthDay () throws JsonProcessingException, IOException {
         collection = "pubDate in 2000-02";
         qs.setQuery(query, ql);
         qs.setCollection(collection);
@@ -534,8 +539,9 @@
         assertEquals("match:leq", res.at("/collection/match").asText());
     }
 
+
     @Test
-    public void testDateValidate() {
+    public void testDateValidate () {
         String fake_date = "fireStorm2014";
         String fake_date_2 = "2014-12Date";
         String date = "2015";
diff --git a/src/test/java/de/ids_mannheim/korap/query/serialize/Cosmas2QueryProcessorTest.java b/src/test/java/de/ids_mannheim/korap/query/serialize/Cosmas2QueryProcessorTest.java
index fa3adc8..9db30b9 100644
--- a/src/test/java/de/ids_mannheim/korap/query/serialize/Cosmas2QueryProcessorTest.java
+++ b/src/test/java/de/ids_mannheim/korap/query/serialize/Cosmas2QueryProcessorTest.java
@@ -18,7 +18,8 @@
  * Tests for JSON-LD serialization of Cosmas II queries.
  * 
  * @author Joachim Bingel (bingel@ids-mannheim.de)
- * @version 1.0
+ * @author Nils Diewald
+ * @version 1.1
  */
 public class Cosmas2QueryProcessorTest {
 
@@ -304,11 +305,17 @@
 
     @Test
     public void testOPORAND () throws JsonProcessingException, IOException {
+
+        // Query
         query = "(Sonne oder Mond) und scheint";
         qs.setQuery(query, "cosmas2");
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:sequence", res.at("/query/operation").asText());
+
+        assertEquals(false, res.at("/query/inOrder").isMissingNode());
+        assertEquals(false, res.at("/query/inOrder").asBoolean());
+
         assertEquals("cosmas:distance", res.at("/query/distances/0/@type")
                 .asText());
         assertEquals("t", res.at("/query/distances/0/key").asText());
@@ -317,6 +324,10 @@
         assertEquals("koral:group", res.at("/query/operands/0/@type").asText());
         assertEquals("operation:disjunction",
                 res.at("/query/operands/0/operation").asText());
+
+        assertEquals(false, res.at("/query/operands/0/inOrder").isMissingNode());
+        assertEquals(false, res.at("/query/operands/0/inOrder").asBoolean());
+
         assertEquals("Sonne", res.at("/query/operands/0/operands/0/wrap/key")
                 .asText());
         assertEquals("Mond", res.at("/query/operands/0/operands/1/wrap/key")
@@ -324,10 +335,15 @@
         assertEquals("koral:token", res.at("/query/operands/1/@type").asText());
         assertEquals("scheint", res.at("/query/operands/1/wrap/key").asText());
 
+        // Query
         query = "scheint und (Sonne oder Mond)";
         qs.setQuery(query, "cosmas2");
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:group", res.at("/query/@type").asText());
+
+        assertEquals(false, res.at("/query/inOrder").isMissingNode());
+        assertEquals(false, res.at("/query/inOrder").asBoolean());
+
         assertEquals("operation:sequence", res.at("/query/operation").asText());
         assertEquals("cosmas:distance", res.at("/query/distances/0/@type")
                 .asText());
@@ -339,16 +355,25 @@
         assertEquals("koral:group", res.at("/query/operands/1/@type").asText());
         assertEquals("operation:disjunction",
                 res.at("/query/operands/1/operation").asText());
+
+        assertEquals(false, res.at("/query/operands/1/inOrder").isMissingNode());
+        assertEquals(false, res.at("/query/operands/1/inOrder").asBoolean());
+
         assertEquals("Sonne", res.at("/query/operands/1/operands/0/wrap/key")
                 .asText());
         assertEquals("Mond", res.at("/query/operands/1/operands/1/wrap/key")
                 .asText());
 
+        // Query
         query = "Regen und scheint und (Sonne oder Mond)";
         qs.setQuery(query, "cosmas2");
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:sequence", res.at("/query/operation").asText());
+
+        assertEquals(false, res.at("/query/inOrder").isMissingNode());
+        assertEquals(false, res.at("/query/inOrder").asBoolean());
+
         assertEquals("cosmas:distance", res.at("/query/distances/0/@type")
                 .asText());
         assertEquals("t", res.at("/query/distances/0/key").asText());
@@ -356,8 +381,14 @@
         assertEquals(0, res.at("/query/distances/0/max").asInt());
         assertEquals("koral:token", res.at("/query/operands/0/@type").asText());
         assertEquals("Regen", res.at("/query/operands/0/wrap/key").asText());
-        assertEquals("koral:group", res.at("/query/@type").asText());
-        assertEquals("operation:sequence", res.at("/query/operation").asText());
+
+        assertEquals("koral:group", res.at("/query/operands/1/@type").asText());
+        assertEquals("operation:sequence", res
+                .at("/query/operands/1/operation").asText());
+
+        assertEquals(false, res.at("/query/operands/1/inOrder").isMissingNode());
+        assertEquals(false, res.at("/query/operands/1/inOrder").asBoolean());
+
         assertEquals("cosmas:distance",
                 res.at("/query/operands/1/distances/0/@type").asText());
         assertEquals("t", res.at("/query/operands/1/distances/0/key").asText());
@@ -367,6 +398,12 @@
                 .asText());
         assertEquals("koral:group", res
                 .at("/query/operands/1/operands/1/@type").asText());
+
+        assertEquals(false, res.at("/query/operands/1/operands/1/inOrder")
+                .isMissingNode());
+        assertEquals(false, res.at("/query/operands/1/operands/1/inOrder")
+                .asBoolean());
+
         assertEquals("operation:disjunction",
                 res.at("/query/operands/1/operands/1/operation").asText());
         assertEquals("Sonne",
@@ -685,7 +722,7 @@
                         .asText());
         assertEquals(
                 "s",
-                res.at("/query/operands/0/operands/0/operands/0/operands/0/key")
+                res.at("/query/operands/0/operands/0/operands/0/operands/0/wrap/key")
                         .asText());
         assertEquals("koral:group",
                 res.at("/query/operands/0/operands/0/operands/1/@type")
@@ -727,8 +764,9 @@
         assertEquals("koral:span",
                 res.at("/query/operands/0/operands/0/operands/0/@type")
                         .asText());
-        assertEquals("s", res.at("/query/operands/0/operands/0/operands/0/key")
-                .asText());
+        assertEquals("s",
+                res.at("/query/operands/0/operands/0/operands/0/wrap/key")
+                        .asText());
         assertEquals("koral:group", res
                 .at("/query/operands/0/operands/1/@type").asText());
         assertEquals("operation:class",
@@ -859,7 +897,7 @@
                         .asText());
         assertEquals(
                 "s",
-                res.at("/query/operands/0/operands/0/operands/0/operands/0/key")
+                res.at("/query/operands/0/operands/0/operands/0/operands/0/wrap/key")
                         .asText());
         assertEquals("koral:group",
                 res.at("/query/operands/0/operands/0/operands/1/@type")
@@ -1400,7 +1438,8 @@
                         .asText());
         assertEquals("koral:span", res.at("/query/operands/0/operands/0/@type")
                 .asText());
-        assertEquals("s", res.at("/query/operands/0/operands/0/key").asText());
+        assertEquals("s", res.at("/query/operands/0/operands/0/wrap/key")
+                .asText());
 
         query = "#BED(der Mann , +pe)";
         qs.setQuery(query, "cosmas2");
@@ -1424,8 +1463,9 @@
         assertEquals("koral:span",
                 res.at("/query/operands/0/operands/0/operands/0/@type")
                         .asText());
-        assertEquals("p", res.at("/query/operands/0/operands/0/operands/0/key")
-                .asText());
+        assertEquals("p",
+                res.at("/query/operands/0/operands/0/operands/0/wrap/key")
+                        .asText());
         assertEquals("koral:reference",
                 res.at("/query/operands/0/operands/1/@type").asText());
         assertEquals("operation:focus",
@@ -1477,8 +1517,9 @@
         assertEquals("koral:span",
                 res.at("/query/operands/0/operands/0/operands/0/@type")
                         .asText());
-        assertEquals("s", res.at("/query/operands/0/operands/0/operands/0/key")
-                .asText());
+        assertEquals("s",
+                res.at("/query/operands/0/operands/0/operands/0/wrap/key")
+                        .asText());
         assertEquals("koral:group",
                 res.at("/query/operands/0/operands/0/operands/1/@type")
                         .asText());
@@ -1512,8 +1553,9 @@
         assertEquals("koral:span",
                 res.at("/query/operands/0/operands/1/operands/0/@type")
                         .asText());
-        assertEquals("p", res.at("/query/operands/0/operands/1/operands/0/key")
-                .asText());
+        assertEquals("p",
+                res.at("/query/operands/0/operands/1/operands/0/wrap/key")
+                        .asText());
         assertEquals("koral:group",
                 res.at("/query/operands/0/operands/1/operands/1/@type")
                         .asText());
@@ -1566,7 +1608,8 @@
                         .asText());
         assertEquals("koral:span", res.at("/query/operands/0/operands/0/@type")
                 .asText());
-        assertEquals("s", res.at("/query/operands/0/operands/0/key").asText());
+        assertEquals("s", res.at("/query/operands/0/operands/0/wrap/key")
+                .asText());
 
         query = "der:sa,-pa";
         qs.setQuery(query, "cosmas2");
@@ -1588,8 +1631,9 @@
         assertEquals("koral:span",
                 res.at("/query/operands/0/operands/0/operands/0/@type")
                         .asText());
-        assertEquals("s", res.at("/query/operands/0/operands/0/operands/0/key")
-                .asText());
+        assertEquals("s",
+                res.at("/query/operands/0/operands/0/operands/0/wrap/key")
+                        .asText());
         assertEquals("koral:group",
                 res.at("/query/operands/0/operands/0/operands/1/@type")
                         .asText());
@@ -1614,8 +1658,9 @@
         assertEquals("koral:span",
                 res.at("/query/operands/0/operands/1/operands/0/@type")
                         .asText());
-        assertEquals("p", res.at("/query/operands/0/operands/1/operands/0/key")
-                .asText());
+        assertEquals("p",
+                res.at("/query/operands/0/operands/1/operands/0/wrap/key")
+                        .asText());
         assertEquals("koral:group",
                 res.at("/query/operands/0/operands/1/operands/1/@type")
                         .asText());
@@ -1650,8 +1695,9 @@
         assertEquals("koral:span",
                 res.at("/query/operands/0/operands/0/operands/0/@type")
                         .asText());
-        assertEquals("s", res.at("/query/operands/0/operands/0/operands/0/key")
-                .asText());
+        assertEquals("s",
+                res.at("/query/operands/0/operands/0/operands/0/wrap/key")
+                        .asText());
         assertEquals("koral:group",
                 res.at("/query/operands/0/operands/0/operands/1/@type")
                         .asText());
@@ -1702,7 +1748,7 @@
                         .asText());
         assertEquals(
                 "p",
-                res.at("/query/operands/0/operands/1/operands/0/operands/0/operands/0/key")
+                res.at("/query/operands/0/operands/1/operands/0/operands/0/operands/0/wrap/key")
                         .asText());
         assertEquals(
                 "koral:group",
@@ -1754,7 +1800,7 @@
                         .asText());
         assertEquals(
                 "t",
-                res.at("/query/operands/0/operands/1/operands/0/operands/1/operands/0/operands/0/key")
+                res.at("/query/operands/0/operands/1/operands/0/operands/1/operands/0/operands/0/wrap/key")
                         .asText());
         assertEquals(
                 "koral:reference",
diff --git a/src/test/java/de/ids_mannheim/korap/query/serialize/EmptyResultsTest.java b/src/test/java/de/ids_mannheim/korap/query/serialize/EmptyResultsTest.java
index fd2e64f..264ca67 100644
--- a/src/test/java/de/ids_mannheim/korap/query/serialize/EmptyResultsTest.java
+++ b/src/test/java/de/ids_mannheim/korap/query/serialize/EmptyResultsTest.java
@@ -5,6 +5,8 @@
 import org.junit.Assert;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+
 /**
  * @author hanl
  * @date 02/07/2015
@@ -13,32 +15,35 @@
 
     private static ObjectMapper mapper = new ObjectMapper();
 
+
     @Test
-    public void testEmptyQueryObject() {
+    public void testEmptyQueryObject () {
         QuerySerializer s = new QuerySerializer();
         s.setQuery("prox/unit=word/distance<=5", "cql");
         JsonNode node = mapper.valueToTree(s.build());
-        Assert.assertEquals(node.has("query"), false);
-        Assert.assertEquals(node.has("collection"), false);
+        assertEquals(node.has("query"), false);
+        assertEquals(node.has("collection"), false);
     }
 
+
     @Test
-    public void testEmptyCollectionObject() {
+    public void testEmptyCollectionObject () {
         QuerySerializer s = new QuerySerializer();
         s.setQuery("[base=Wort]", "poliqarp");
 
         JsonNode node = mapper.valueToTree(s.build());
-        Assert.assertEquals(node.has("query"), true);
-        Assert.assertEquals(node.has("collection"), false);
+        assertEquals(node.has("query"), true);
+        assertEquals(node.has("collection"), false);
     }
 
+
     @Test
-    public void testEmptyMetaObject() {
+    public void testEmptyMetaObject () {
         QuerySerializer s = new QuerySerializer();
         s.setQuery("[base=Wort]", "poliqarp");
 
         JsonNode node = mapper.valueToTree(s.build());
-        Assert.assertEquals(node.has("meta"), false);
+        assertEquals(node.has("meta"), false);
     }
 
 }
diff --git a/src/test/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessorTest.java b/src/test/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessorTest.java
index 171f1b3..221c0bc 100644
--- a/src/test/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessorTest.java
+++ b/src/test/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessorTest.java
@@ -148,6 +148,7 @@
         query = "z.B./x";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
+        System.out.println("QUERY IS  " + res);
         assertEquals("koral:token", res.at("/query/@type").asText());
         assertEquals("koral:term", res.at("/query/wrap/@type").asText());
         assertEquals(".*?z\\.B\\..*?", res.at("/query/wrap/key").asText());
@@ -159,12 +160,13 @@
         query = "\"a\\.\"";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
+        System.out.println("QUERY IS  " + res);
         assertEquals("koral:token", res.at("/query/@type").asText());
         assertEquals("koral:term", res.at("/query/wrap/@type").asText());
-        assertEquals("a\\.", res.at("/query/wrap/key").asText());
         assertEquals("type:regex", res.at("/query/wrap/type").asText());
         assertEquals("orth", res.at("/query/wrap/layer").asText());
         assertEquals("match:eq", res.at("/query/wrap/match").asText());
+        assertEquals("a\\.", res.at("/query/wrap/key").asText());
     }
 
 
@@ -1697,12 +1699,41 @@
         res = mapper.readTree(qs.toJSON());
         assertEquals("operation:position", res.at("/query/operation").asText());
         assertEquals("frames:isAround", res.at("/query/frames/0").asText());
-        assertEquals("s", res.at("/query/operands/0/key").asText());
+        assertEquals("s", res.at("/query/operands/0/wrap/key").asText());
         assertEquals("VVFIN", res.at("/query/operands/1/wrap/key").asText());
     }
 
 
     @Test
+    public void testSpanSerialization () throws JsonProcessingException,
+            IOException {
+
+        // Both constructs should be serialized identically
+        query = "contains(<s>, der)";
+        qs.setQuery(query, "poliqarpplus");
+        res = mapper.readTree(qs.toJSON());
+        assertEquals("koral:group", res.at("/query/@type").asText());
+        assertEquals("operation:position", res.at("/query/operation").asText());
+        assertEquals("frames:isAround", res.at("/query/frames/0").asText());
+        assertEquals(true, res.at("/query/frames/1").isMissingNode());
+        assertEquals("koral:span", res.at("/query/operands/0/@type").asText());
+        assertEquals("s", res.at("/query/operands/0/wrap/key").asText());
+        assertEquals("koral:token", res.at("/query/operands/1/@type").asText());
+
+        query = "der within s";
+        qs.setQuery(query, "poliqarpplus");
+        res = mapper.readTree(qs.toJSON());
+        assertEquals("koral:group", res.at("/query/@type").asText());
+        assertEquals("operation:position", res.at("/query/operation").asText());
+        assertEquals("frames:isAround", res.at("/query/frames/0").asText());
+        assertEquals(true, res.at("/query/frames/1").isMissingNode());
+        assertEquals("koral:span", res.at("/query/operands/0/@type").asText());
+        assertEquals("s", res.at("/query/operands/0/wrap/key").asText());
+        assertEquals("koral:token", res.at("/query/operands/1/@type").asText());
+    }
+
+
+    @Test
     public void testMeta () throws JsonProcessingException, IOException {
         query = "x meta textClass=Sport";
         qs.setQuery(query, "poliqarpplus");
