diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/AnnisQueryProcessor.java b/src/main/java/de/ids_mannheim/korap/query/serialize/AnnisQueryProcessor.java
index 37a32b3..a1c75ac 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/AnnisQueryProcessor.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/AnnisQueryProcessor.java
@@ -84,7 +84,7 @@
     /**
      * Keeps a record of unary relations on spans/tokens.
      */
-    private LinkedHashMap<String, ParseTree> unaryRelations = new LinkedHashMap<String, ParseTree>();
+    private LinkedHashMap<String, ArrayList<ParseTree>> unaryRelations = new LinkedHashMap<String, ArrayList<ParseTree>>();
     /**
      * Keeps track of the number of references to a node/token by means of #n. E.g. in the query 
      * <tt>tok="x" & tok="y" & tok="z" & #1 . #2 & #2 . #3</tt>, the 2nd token ("y") is referenced twice, the others once.
@@ -231,7 +231,10 @@
         // and stores them in a list for later reference.
         for (ParseTree unaryTermNode : getDescendantsWithCat(node, "unary_linguistic_term")) {
             String ref = getNodeCat(unaryTermNode.getChild(0)).substring(1);
-            unaryRelations.put(ref, unaryTermNode);
+            ArrayList<ParseTree> unaryTermsForRef = unaryRelations.get(ref);
+            if (unaryTermsForRef == null) unaryTermsForRef = new ArrayList<ParseTree>();
+            unaryTermsForRef.add(unaryTermNode);
+            unaryRelations.put(ref, unaryTermsForRef);
         }
         for (ParseTree lingTermNode : getDescendantsWithCat(node, "n_ary_linguistic_term")) {
             for (ParseTree refOrNode : getChildrenWithCat(lingTermNode, "refOrNode")) {
@@ -302,6 +305,7 @@
         }
     }
 
+    @SuppressWarnings("unchecked")
     private LinkedHashMap<String, Object> processVariableExpr(ParseTree node) {
         // simplex word or complex assignment (like qname = textSpec)?
         String firstChildNodeCat = getNodeCat(node.getChild(0));
@@ -351,15 +355,20 @@
         // Check if there's a unary relation defined for this node
         // If yes, parse and retrieve it and put it in the object. 
         String ref = nodes2refs.get(node);
-        System.err.println(ref);
-        System.err.println(unaryRelations);
         if (unaryRelations.containsKey(ref)) {
-            object.put("attr", 
-                    parseUnaryOperator(unaryRelations.get(ref)));
+            ArrayList<ParseTree> unaryTermsForRef = unaryRelations.get(ref);
+            if (unaryTermsForRef.size() == 1) {
+                object.put("attr", 
+                        parseUnaryOperator(unaryTermsForRef.get(0)));   
+            } else {
+                LinkedHashMap<String, Object> termGroup = KoralObjectGenerator.makeTermGroup("and");
+                ArrayList<Object> operands = (ArrayList<Object>) termGroup.get("operands");
+                for (ParseTree unaryTerm : unaryTermsForRef) {
+                    operands.add(parseUnaryOperator(unaryTerm));
+                }
+                object.put("attr", termGroup);
+            }
         }
-        System.err.println(object);
-        System.err.println(nodeVariables);
-        
         if (object != null) {
             // query: object only, no relation
             if (totalRelationCount == 0) {
@@ -431,10 +440,6 @@
         String operandRef = operand.getText();
         if (operandRef.startsWith("#")) {
             operandRef = operandRef.substring(1, operandRef.length());
-            if (verbose) {
-                System.out.println(operandRef);
-                System.out.println(nodeReferencesProcessed);   
-            }
             if (nodeReferencesProcessed.get(operandRef) > 0) {
                 return true;
             }
@@ -465,9 +470,6 @@
                     queuedRelations.add(node);
                     relationCounter--;
                     if (verbose) {
-                        System.out.println(operandTree1.toStringTree(parser));
-                        System.out.println(operandTree2.toStringTree(parser));
-                        System.out.println(nodeReferencesProcessed);
                         System.out.println("Adding to queue: "+node.getText());
                     }
                     objectsToPop.push(stackedObjects);
diff --git a/src/test/java/de/ids_mannheim/korap/query/serialize/AnnisQueryProcessorTest.java b/src/test/java/de/ids_mannheim/korap/query/serialize/AnnisQueryProcessorTest.java
index f01a38a..b14b9a9 100644
--- a/src/test/java/de/ids_mannheim/korap/query/serialize/AnnisQueryProcessorTest.java
+++ b/src/test/java/de/ids_mannheim/korap/query/serialize/AnnisQueryProcessorTest.java
@@ -885,7 +885,22 @@
         assertEquals("NP",              res.at("/query/key").asText());
         assertEquals("korap:term",      res.at("/query/attr/@type").asText());
         assertEquals(true,              res.at("/query/attr/root").asBoolean());
-
+        
+        query = "cnx/cat=\"NP\" & #1:root & #1:arity=2";
+        qs.setQuery(query, "annis");
+        res = mapper.readTree(qs.toJSON());
+        assertEquals("korap:span",      res.at("/query/@type").asText());
+        assertEquals("cnx",             res.at("/query/foundry").asText());
+        assertEquals("c",               res.at("/query/layer").asText());
+        assertEquals("NP",              res.at("/query/key").asText());
+        assertEquals("korap:termGroup", res.at("/query/attr/@type").asText());
+        assertEquals("korap:term",      res.at("/query/attr/operands/0/@type").asText());
+        assertEquals(true,              res.at("/query/attr/operands/0/root").asBoolean());
+        assertEquals("korap:term",      res.at("/query/attr/operands/1/@type").asText());
+        assertEquals("korap:boundary",  res.at("/query/attr/operands/1/arity/@type").asText());
+        assertEquals(2,                 res.at("/query/attr/operands/1/arity/min").asInt());
+        assertEquals(2,                 res.at("/query/attr/operands/1/arity/max").asInt());
+        
         query = "cnx/cat=\"NP\" & node & #1>#2 & #1:tokenarity=2";
         qs.setQuery(query, "annis");
         res = mapper.readTree(qs.toJSON());
