diff --git a/src/main/java/de/ids_mannheim/korap/query/parse/fcsql/ExpressionParser.java b/src/main/java/de/ids_mannheim/korap/query/parse/fcsql/ExpressionParser.java
index 1fd9f6e..3565db1 100644
--- a/src/main/java/de/ids_mannheim/korap/query/parse/fcsql/ExpressionParser.java
+++ b/src/main/java/de/ids_mannheim/korap/query/parse/fcsql/ExpressionParser.java
@@ -6,6 +6,8 @@
 import java.util.List;
 import java.util.Set;
 
+import org.omg.CosNaming.IstringHelper;
+
 import de.ids_mannheim.korap.query.object.KoralMatchOperator;
 import de.ids_mannheim.korap.query.object.KoralObject;
 import de.ids_mannheim.korap.query.object.KoralTermGroupRelation;
@@ -82,16 +84,16 @@
             List<QueryNode> operands = queryNode.getChildren();
             if (isNot) {
                 return parseBooleanExpression(operands,
-                        KoralTermGroupRelation.OR);
+                        KoralTermGroupRelation.OR, isToken);
             }
             else {
                 return parseBooleanExpression(operands,
-                        KoralTermGroupRelation.AND);
+                        KoralTermGroupRelation.AND, isToken);
             }
         }
         else if (queryNode instanceof ExpressionGroup) {
             // Ignore the group
-            return parseExpression(queryNode.getFirstChild());
+            return parseExpression(queryNode.getFirstChild(), false, isToken);
         }
         else if (queryNode instanceof ExpressionNot) {
             boolean negation = isNot ? false : true;
@@ -101,11 +103,11 @@
             List<QueryNode> operands = queryNode.getChildren();
             if (isNot) {
                 return parseBooleanExpression(operands,
-                        KoralTermGroupRelation.AND);
+                        KoralTermGroupRelation.AND, isToken);
             }
             else {
                 return parseBooleanExpression(operands,
-                        KoralTermGroupRelation.OR);
+                        KoralTermGroupRelation.OR, isToken);
             }
         }
         else if (queryNode instanceof ExpressionWildcard) {
@@ -129,14 +131,20 @@
      * @return a koral token
      * @throws KoralException
      */
-    private KoralToken parseBooleanExpression(List<QueryNode> operands,
-            KoralTermGroupRelation relation) throws KoralException {
+    private KoralObject parseBooleanExpression(List<QueryNode> operands,
+            KoralTermGroupRelation relation, boolean isToken) throws KoralException {
         List<KoralObject> terms = new ArrayList<>();
         for (QueryNode node : operands) {
             terms.add(parseExpression(node, false, false));
         }
+        
         KoralTermGroup termGroup = new KoralTermGroup(relation, terms);
-        return new KoralToken(termGroup);
+        if (isToken){        
+            return new KoralToken(termGroup);
+        }
+        else {
+            return termGroup;
+        }
     }
 
     /**
diff --git a/src/test/java/de/ids_mannheim/korap/query/serialize/FCSQLQueryProcessorTest.java b/src/test/java/de/ids_mannheim/korap/query/serialize/FCSQLQueryProcessorTest.java
index 8dc4cf0..407e6bd 100644
--- a/src/test/java/de/ids_mannheim/korap/query/serialize/FCSQLQueryProcessorTest.java
+++ b/src/test/java/de/ids_mannheim/korap/query/serialize/FCSQLQueryProcessorTest.java
@@ -237,26 +237,29 @@
     @Test
     public void testMultipleBooleanExpressions() throws IOException {
         query = "[mate:lemma=\"sein\" & (mate:pos=\"PPOSS\"|mate:pos=\"VAFIN\")]";
-        jsonLd = "{@type: koral:token,"
-                + " wrap: { @type: koral:termGroup,"
+        jsonLd = "{@type: koral:termGroup,"
                 + "relation: relation:or,"
                 + " operands:["
                 + "{@type: koral:term, key: PPOSS, foundry: mate, layer: p, type:type:regex, match: match:eq},"
-                + "{@type: koral:term, key: VAFIN, foundry: mate, layer: p, type:type:regex, match: match:eq}]}}";
+                + "{@type: koral:term, key: VAFIN, foundry: mate, layer: p, type:type:regex, match: match:eq}]}";
         FCSQLQueryProcessorTest.validateNode(query, "/query/wrap/operands/1",
                 jsonLd);
         FCSQLQueryProcessorTest.validateNode(query, "/query/wrap/relation",
                 "relation:and");
         
-        query = "[(cnx:lemma=\"sein\" | mate:pos=\"PPOSS\") | mate:pos=\"PPOSS\"]";
-        jsonLd = "{@type: koral:token,"
-                + " wrap: { @type: koral:termGroup,"
+        query = "[(cnx:lemma=\"sein\" | mate:pos=\"PPOSS\") | mate:pos=\"VAFIN\"]";
+        jsonLd = "{@type: koral:termGroup,"
                 + "relation: relation:or,"
                 + " operands:["
                 + "{@type: koral:term, key: sein, foundry: cnx, layer: l, type:type:regex, match: match:eq},"
-                + "{@type: koral:term, key: PPOSS, foundry: mate, layer: p, type:type:regex, match: match:eq}]}}";
+                + "{@type: koral:term, key: PPOSS, foundry: mate, layer: p, type:type:regex, match: match:eq}]}";
         FCSQLQueryProcessorTest.validateNode(query, "/query/wrap/operands/0",
                 jsonLd);
+        
+        query = "[(cnx:lemma=\"sein\" | mate:pos=\"PPOSS\") & text=\"ist\"]";
+        jsonLd = "{@type: koral:term, key: ist, foundry: opennlp, layer: orth, type:type:regex, match: match:eq}";
+        FCSQLQueryProcessorTest.validateNode(query, "/query/wrap/operands/1",
+                jsonLd);
     }
 
     // "!" expression /* not */
