diff --git a/Changes b/Changes
index 3a859d4..097242c 100644
--- a/Changes
+++ b/Changes
@@ -3,6 +3,7 @@
 	- Updated maven dependency phase (margaretha)
     - Fixed handling of non-necessary brackets in tokens (diewald)
     - Improved error handling (margaretha)
+    - Added wrap to koral:span serialization (margaretha)
 
 0.25 2017-05-10
 	- Altered dominance and relation serialization (margaretha)
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 ca88711..0155d71 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
@@ -521,15 +521,6 @@
         }
         else {
             posGroup = KoralObjectGenerator.makeGroup(KoralOperation.POSITION);
-            // mark this an inverted operands object
-            invertedOperandsLists
-                    .push((ArrayList<Object>) posGroup.get("operands"));
-            wrapOperandInClass(node, 2, 128 + classCounter++);
-            wrapOperandInClass(node, 1, 128 + classCounter++);
-            // EM: why bother inverting the operands and creating classes and focus? 
-            // can't we agree on the first operand to be the results, like in 
-            // operation:exclusion?
-
         }
 
         Map<String, Object> positionOptions;
@@ -568,12 +559,12 @@
                                 .get("classRefCheck"),
                         posGroup);
             }
-            posGroup = addClassFocus((boolean) positionOptions.get("matchall"),
-                    posGroup);
+//            posGroup = addClassFocus((boolean) positionOptions.get("matchall"),
+//                    posGroup);
         }
 
         // wrap in 'merge' operation if grouping option is set
-        if (positionOptions.containsKey("grouping")
+        if (!isExclusion && positionOptions.containsKey("grouping")
                 && (boolean) positionOptions.get("grouping")) {
             Map<String, Object> mergeOperation = KoralObjectGenerator
                     .makeGroup(KoralOperation.MERGE);
@@ -1154,31 +1145,32 @@
         ArrayList<ClassRefCheck> classRefCheck = new ArrayList<ClassRefCheck>();
         posOptions.put("matchall", false);
 
-        String posOption = null;
+        String posOption = "";
         if (posnode != null) {
             posOption = posnode.getChild(0).toStringTree().toUpperCase();
-            if (isExclusion) {
-                checkINWithExclusionOptions(posOption, positions,
-                        classRefCheck);
-            }
-            else {
-                checkINOptions(posOption, positions, classRefCheck);
-            }
+        }
+
+        if (isExclusion) {
+            checkINWithExclusionOptions(posOption, positions,
+                    classRefCheck);
         }
         else {
-            classRefCheck.add(ClassRefCheck.INCLUDES);
+            checkINOptions(posOption, positions, classRefCheck);
         }
 
         posOptions.put("frames", Converter.enumListToStringList(positions));
         posOptions.put("classRefCheck", classRefCheck);
-        if (rangenode != null) {
+        if (!isExclusion && rangenode != null) {
             String range = rangenode.getChild(0).toStringTree().toLowerCase();
-            if (range.equals("all")) {
-                posOptions.put("matchall", true);
+            // ALL is default in KorAP
+            // if (range.equals("all")) {
+                
+                // posOptions.put("matchall", true);
                 // Map<String,Object> ref =
                 // makeResetReference(); // reset all defined classes
                 // wrapOperand(node,2,ref);
-            }
+            //}
+            // HIT is default in C2
         }
 
         Boolean grouping = false;
@@ -1197,33 +1189,28 @@
             ArrayList<ClassRefCheck> classRefCheck) {
         switch (posOption) {
             case "L":
-                positions.add(KoralFrame.STARTS_WITH);
-                positions.add(KoralFrame.MATCHES);
-                //                    classRefCheck.add("classRefCheck:includes");
+                positions.add(KoralFrame.ALIGNS_LEFT);
                 break;
             case "R":
-                positions.add(KoralFrame.ENDS_WITH);
-                positions.add(KoralFrame.MATCHES);
-                //                    classRefCheck.add("classRefCheck:includes");
+                positions.add(KoralFrame.ALIGNS_RIGHT);
                 break;
             case "F":
-                positions.add(KoralFrame.MATCHES);
-                //                    classRefCheck.add("classRefCheck:includes");
                 break;
             case "FE":
-                positions.add(KoralFrame.MATCHES);
                 classRefCheck.add(ClassRefCheck.EQUALS);
                 break;
             case "FI":
-                positions.add(KoralFrame.MATCHES);
                 classRefCheck.add(ClassRefCheck.UNEQUALS);
-                //                    classRefCheck.add("classRefCheck:includes");
                 break;
             case "N":
-                positions.add(KoralFrame.IS_AROUND);
-                //                    classRefCheck.add("classRefCheck:includes");
+                positions.add(KoralFrame.IS_WITHIN);
                 break;
+            default:
+                positions.add(KoralFrame.ALIGNS_LEFT);
+                positions.add(KoralFrame.ALIGNS_RIGHT);
+                positions.add(KoralFrame.IS_WITHIN);
         }
+        positions.add(KoralFrame.MATCHES);
     }
 
 
@@ -1248,8 +1235,9 @@
         }
         else if (CosmasPosition.F.name().equals(posOption)) {}
         else {
-            // throw an error or add an exception;
-            return;
+            positions.add(KoralFrame.ALIGNS_LEFT);
+            positions.add(KoralFrame.ALIGNS_RIGHT);
+            positions.add(KoralFrame.IS_WITHIN);
         }
 
         positions.add(KoralFrame.MATCHES);
diff --git a/src/test/java/de/ids_mannheim/korap/test/cosmas2/OPINTest.java b/src/test/java/de/ids_mannheim/korap/test/cosmas2/OPINTest.java
index d32195c..d58c223 100644
--- a/src/test/java/de/ids_mannheim/korap/test/cosmas2/OPINTest.java
+++ b/src/test/java/de/ids_mannheim/korap/test/cosmas2/OPINTest.java
@@ -13,6 +13,9 @@
 
 import de.ids_mannheim.korap.query.serialize.QuerySerializer;
 
+// EM: OPIN always returns the combination span of both operands
+// MAX groups all first operand spans that are in a same second operand span
+
 public class OPINTest {
     private String query;
 
@@ -26,69 +29,35 @@
         query = "wegen #IN <s>";
         qs.setQuery(query, "cosmas2");
         res = mapper.readTree(qs.toJSON());
-        assertEquals("koral:reference", res.at("/query/@type").asText());
-        assertEquals("operation:focus", res.at("/query/operation").asText());
-        assertEquals(130, res.at("/query/classRef/0").asInt());
-        assertEquals("koral:group", res.at("/query/operands/0/@type").asText());
-        assertEquals("operation:class",
-                res.at("/query/operands/0/operation").asText());
-        assertEquals("classRefCheck:includes",
-                res.at("/query/operands/0/classRefCheck/0").asText());
-        assertEquals("koral:group",
-                res.at("/query/operands/0/operands/0/@type").asText());
+
+        assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:position",
-                res.at("/query/operands/0/operands/0/operation").asText());
-        assertEquals(true, res.at("/query/operands/0/operands/0/frames/0")
-                .isMissingNode());
-        assertEquals(129, res.at("/query/operands/0/classIn/0").asInt());
-        assertEquals(130, res.at("/query/operands/0/classIn/1").asInt());
-        assertEquals(131, res.at("/query/operands/0/classOut").asInt());
-        assertEquals("koral:group",
-                res.at("/query/operands/0/operands/0/@type").asText());
-        assertEquals("operation:class",
-                res.at("/query/operands/0/operands/0/operands/0/operation")
-                        .asText());
-        assertEquals(129,
-                res.at("/query/operands/0/operands/0/operands/0/classOut")
-                        .asInt());
-        assertEquals("koral:span",
-                res.at("/query/operands/0/operands/0/operands/0/operands/0/@type")
-                        .asText());
-        assertEquals("s",
-                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").asText());
-        assertEquals("operation:class",
-                res.at("/query/operands/0/operands/0/operands/1/operation")
-                        .asText());
-        assertEquals(130,
-                res.at("/query/operands/0/operands/0/operands/1/classOut")
-                        .asInt());
-        assertEquals("koral:token",
-                res.at("/query/operands/0/operands/0/operands/1/operands/0/@type")
-                        .asText());
-        assertEquals("wegen",
-                res.at("/query/operands/0/operands/0/operands/1/operands/0/wrap/key")
-                        .asText());
+                res.at("/query/operation").asText());
+        assertEquals(4, res.at("/query/frames").size());
+        assertEquals("frames:alignsLeft", res.at("/query/frames/0").asText());
+        assertEquals("frames:alignsRight", res.at("/query/frames/1").asText());
+        assertEquals("frames:isWithin", res.at("/query/frames/2").asText());
+        assertEquals("frames:matches", res.at("/query/frames/3").asText());
+        assertEquals("koral:token", res.at("/query/operands/0/@type").asText());
+        assertEquals("koral:span", res.at("/query/operands/1/@type").asText());
     }
 
 
     @Test
-   
     public void testOPINWithOptionN ()
             throws JsonProcessingException, IOException {
         query = "wegen #IN(N) <s>";
         qs.setQuery(query, "cosmas2");
         res = mapper.readTree(qs.toJSON());
-        assertEquals("koral:reference", res.at("/query/@type").asText());
-        assertEquals("operation:focus", res.at("/query/operation").asText());
-        assertEquals(130, res.at("/query/classRef/0").asInt());
-        assertEquals("koral:group", res.at("/query/operands/0/@type").asText());
+        assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:position",
-                res.at("/query/operands/0/operation").asText());
-        assertEquals("frames:isAround",
-                res.at("/query/operands/0/frames/0").asText());
+                res.at("/query/operation").asText());
+        assertEquals("frames:isWithin",
+                res.at("/query/frames/0").asText());
+        assertEquals("wegen",
+                res.at("/query/operands/0/wrap/key").asText());
+        assertEquals("s",
+                res.at("/query/operands/1/wrap/key").asText());
     }
     
     
@@ -98,39 +67,39 @@
         query = "wegen #IN(L) <s>";
         qs.setQuery(query, "cosmas2");
         res = mapper.readTree(qs.toJSON());
-        assertEquals("koral:reference", res.at("/query/@type").asText());
-        assertEquals("operation:focus", res.at("/query/operation").asText());
-        assertEquals(130, res.at("/query/classRef/0").asInt());
-        assertEquals("koral:group", res.at("/query/operands/0/@type").asText());
+        
         assertEquals("operation:position",
-                res.at("/query/operands/0/operation").asText());
-        assertEquals("frames:startsWith",
-                res.at("/query/operands/0/frames/0").asText());
+                res.at("/query/operation").asText());
+        assertEquals(2, res.at("/query/frames").size());
+        assertEquals("frames:alignsLeft",
+                res.at("/query/frames/0").asText());
         assertEquals("frames:matches",
-                res.at("/query/operands/0/frames/1").asText());
-        assertEquals(true,
-                res.at("/query/operands/0/frames/2").isMissingNode());
-        assertEquals("koral:group", res.at("/query/operands/0/@type").asText());
-        assertEquals("operation:class",
-                res.at("/query/operands/0/operands/0/operation").asText());
-        assertEquals(129,
-                res.at("/query/operands/0/operands/0/classOut").asInt());
-        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/wrap/key")
-                        .asText());
-        assertEquals("koral:group",
-                res.at("/query/operands/0/operands/1/@type").asText());
-        assertEquals("operation:class",
-                res.at("/query/operands/0/operands/1/operation").asText());
-        assertEquals(130,
-                res.at("/query/operands/0/operands/1/classOut").asInt());
-        assertEquals("koral:token", res
-                .at("/query/operands/0/operands/1/operands/0/@type").asText());
+                res.at("/query/frames/1").asText());
+
         assertEquals("wegen",
-                res.at("/query/operands/0/operands/1/operands/0/wrap/key")
-                        .asText());
+                res.at("/query/operands/0/wrap/key").asText());
+        assertEquals("s",
+                res.at("/query/operands/1/wrap/key").asText());
+    }
+    
+    @Test
+    public void testOPINWithOptionR ()
+            throws JsonProcessingException, IOException {
+        query = "wegen #IN(R) <s>";
+        qs.setQuery(query, "cosmas2");
+        res = mapper.readTree(qs.toJSON());
+        
+        assertEquals("operation:position",
+                res.at("/query/operation").asText());
+        assertEquals("frames:alignsRight",
+                res.at("/query/frames/0").asText());
+        assertEquals("frames:matches",
+                res.at("/query/frames/1").asText());
+        assertEquals(2, res.at("/query/frames").size());
+        assertEquals("wegen",
+                res.at("/query/operands/0/wrap/key").asText());
+        assertEquals("s",
+                res.at("/query/operands/1/wrap/key").asText());
     }
 
     @Test
@@ -142,9 +111,9 @@
         assertEquals(true,
                 res.at("/query/operands/0/classRefCheck").isMissingNode());
         assertEquals("frames:matches",
-                res.at("/query/operands/0/frames/0").asText());
+                res.at("/query/frames/0").asText());
         assertEquals(true,
-                res.at("/query/operands/0/frames/1").isMissingNode());
+                res.at("/query/frames/1").isMissingNode());
     }
 
 
@@ -155,10 +124,10 @@
         qs.setQuery(query, "cosmas2");
         res = mapper.readTree(qs.toJSON());
         assertEquals("classRefCheck:unequals",
-                res.at("/query/operands/0/classRefCheck/0").asText());
+                res.at("/query/classRefCheck/0").asText());
         assertEquals("frames:matches",
-                res.at("/query/operands/0/operands/0/frames/0").asText());
-        assertEquals(true, res.at("/query/operands/0/operands/0/frames/1")
+                res.at("/query/operands/0/frames/0").asText());
+        assertEquals(true, res.at("/query/operands/0/frames/1")
                 .isMissingNode());
         
     }
@@ -171,38 +140,63 @@
         qs.setQuery(query, "cosmas2");
         res = mapper.readTree(qs.toJSON());
         assertEquals("classRefCheck:equals",
-                res.at("/query/operands/0/classRefCheck/0").asText());
+                res.at("/query/classRefCheck/0").asText());
         assertEquals("frames:matches",
-                res.at("/query/operands/0/operands/0/frames/0").asText());
-        assertEquals(true, res.at("/query/operands/0/operands/0/frames/1")
+                res.at("/query/operands/0/frames/0").asText());
+        assertEquals(true, res.at("/query/operands/0/frames/1")
                 .isMissingNode());
     }
 
     @Test
-    @Ignore
-    public void testOPINWithOptionN_MAX ()
+    public void testOPINWithOptionN_ALL ()
             throws JsonProcessingException, IOException {
-        query = "wegen #IN(N, MAX) <s>";
+        // ALL is default in KorAP
+        query = "sich #IN(N,ALL) (&gelten /w5:10 zurecht)";
         qs.setQuery(query, "cosmas2");
         res = mapper.readTree(qs.toJSON());
-        // System.out.println(res.toString());
-        assertEquals("koral:reference", res.at("/query/@type").asText());
-        assertEquals("operation:focus", res.at("/query/operation").asText());
-        assertEquals(130, res.at("/query/classRef/0").asInt());
-        assertEquals("koral:group", res.at("/query/operands/0/@type").asText());
+        assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:position",
-                res.at("/query/operands/0/operation").asText());
-        assertEquals("frames:isAround",
-                res.at("/query/operands/0/frames/0").asText());
+                res.at("/query/operation").asText());
+        assertEquals("frames:isWithin",
+                res.at("/query/frames/0").asText());
+        assertEquals("frames:matches",
+                res.at("/query/frames/1").asText());
+        assertEquals("sich",
+                res.at("/query/operands/0/wrap/key").asText());
+        assertEquals("gelten",
+                res.at("/query/operands/1/operands/0/operands/0/wrap/key").asText());
+        assertEquals("zurecht",
+                res.at("/query/operands/1/operands/1/operands/0/wrap/key").asText());
     }
     
     @Test
     public void testOPINWithOptionN_HIT ()
             throws JsonProcessingException, IOException {
-        query = "wegen #IN(N, HIT) <s>";
+        // EM: KorAP does not support matching in multiple hits?   
+        query = "gilt #IN(N,HIT) (&gelten /w5:10 zurecht)";
         qs.setQuery(query, "cosmas2");
         res = mapper.readTree(qs.toJSON());
-        // System.out.println(res.toString());
+        assertEquals("koral:group", res.at("/query/@type").asText());
+        assertEquals("operation:position",
+                res.at("/query/operation").asText());
+        assertEquals("frames:isWithin",
+                res.at("/query/frames/0").asText());
+        assertEquals("frames:matches",
+                res.at("/query/frames/1").asText());
+        assertEquals("wegen",
+                res.at("/query/operands/0/wrap/key").asText());
+        assertEquals("s",
+                res.at("/query/operands/1/wrap/key").asText());
+    }
+    
+    @Test
+    public void testOPINWithOptionN_MAX ()
+            throws JsonProcessingException, IOException {
+        // EM: Fix operation:merge
+        query = "wegen #IN(N, MAX) <s>";
+        qs.setQuery(query, "cosmas2");
+        res = mapper.readTree(qs.toJSON());
+
         assertEquals("koral:reference", res.at("/query/@type").asText());
         assertEquals("operation:focus", res.at("/query/operation").asText());
         assertEquals(130, res.at("/query/classRef/0").asInt());
@@ -212,6 +206,4 @@
         assertEquals("frames:isAround",
                 res.at("/query/operands/0/frames/0").asText());
     }
-    
-
 }
diff --git a/src/test/java/de/ids_mannheim/korap/test/cosmas2/OPINWithExclusionTest.java b/src/test/java/de/ids_mannheim/korap/test/cosmas2/OPINWithExclusionTest.java
index 3246141..9d410dc 100644
--- a/src/test/java/de/ids_mannheim/korap/test/cosmas2/OPINWithExclusionTest.java
+++ b/src/test/java/de/ids_mannheim/korap/test/cosmas2/OPINWithExclusionTest.java
@@ -4,7 +4,6 @@
 
 import java.io.IOException;
 
-import org.junit.Ignore;
 import org.junit.Test;
 
 import com.fasterxml.jackson.core.JsonProcessingException;
@@ -13,6 +12,8 @@
 
 import de.ids_mannheim.korap.query.serialize.QuerySerializer;
 
+// EM: exclusion always returns the first operand
+
 public class OPINWithExclusionTest {
     private String query;
 
@@ -20,6 +21,24 @@
     private ObjectMapper mapper = new ObjectMapper();
     private JsonNode res;
 
+    @Test
+    public void testOPINWithExclusion ()
+            throws JsonProcessingException, IOException {
+        query = "wegen #IN(%) <s>";
+        qs.setQuery(query, "cosmas2");
+        res = mapper.readTree(qs.toJSON());
+
+        assertEquals("koral:group", res.at("/query/@type").asText());
+        assertEquals("operation:exclusion",
+                res.at("/query/operation").asText());
+        assertEquals(4, res.at("/query/frames").size());
+        assertEquals("frames:alignsLeft", res.at("/query/frames/0").asText());
+        assertEquals("frames:alignsRight", res.at("/query/frames/1").asText());
+        assertEquals("frames:matches", res.at("/query/frames/3").asText());
+        assertEquals("frames:isWithin", res.at("/query/frames/2").asText());
+        assertEquals("koral:token", res.at("/query/operands/0/@type").asText());
+        assertEquals("koral:span", res.at("/query/operands/1/@type").asText());
+    }
 
     @Test
     public void testOPINWithExclusionN ()
@@ -125,6 +144,8 @@
     }
 
 
+    // EM: MIN, MAX does not matter with %
+    
     @Test
     public void testOPINwithExclusionFE_MIN ()
             throws JsonProcessingException, IOException {
@@ -141,23 +162,42 @@
                 res.at("/query/operands/0/frames/0").asText());
     }
 
+    @Test
+    public void testOPINwithExclusionFE_MAX ()
+            throws JsonProcessingException, IOException {
+        query = "wegen #IN(FE,%,MAX) <s>";
+        qs.setQuery(query, "cosmas2");
+        res = mapper.readTree(qs.toJSON());
+        
+        assertEquals("operation:class", res.at("/query/operation").asText());
+        assertEquals("classRefCheck:unequals",
+                res.at("/query/classRefCheck/0").asText());
+
+        JsonNode classRefCheckOperand = res.at("/query/operands/0");
+        assertEquals("operation:exclusion",
+                classRefCheckOperand.at("/operation").asText());
+        assertEquals(1, classRefCheckOperand.at("/frames").size());
+        assertEquals("frames:matches",
+                classRefCheckOperand.at("/frames/0").asText());
+    }
 
     @Test
     public void testOPINwithExclusionN_MAX ()
             throws JsonProcessingException, IOException {
+
         query = "wegen #IN(N,%,MAX) <s>";
         qs.setQuery(query, "cosmas2");
         res = mapper.readTree(qs.toJSON());
-
-        assertEquals("operation:merge", res.at("/query/operation").asText());
+        
+        assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:exclusion",
-                res.at("/query/operands/0/operation").asText());
-        assertEquals(1, res.at("/query/operands/0/frames").size());
-        assertEquals("frames:isWithin",
-                res.at("/query/operands/0/frames/0").asText());
+                res.at("/query/operation").asText());
+        assertEquals(1, res.at("/query/frames").size());
+        assertEquals("frames:isWithin", res.at("/query/frames/0").asText());
+        assertEquals("koral:token", res.at("/query/operands/0/@type").asText());
+        assertEquals("koral:span", res.at("/query/operands/1/@type").asText());
     }
 
-
     @Test
     public void testOPINwithExclusionL_MAX ()
             throws JsonProcessingException, IOException {
@@ -165,97 +205,75 @@
         qs.setQuery(query, "cosmas2");
         res = mapper.readTree(qs.toJSON());
         
-        assertEquals("operation:merge", res.at("/query/operation").asText());
+        assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:exclusion",
-                res.at("/query/operands/0/operation").asText());
-        assertEquals(2, res.at("/query/operands/0/frames").size());
-        assertEquals("frames:alignsLeft",
-                res.at("/query/operands/0/frames/0").asText());
-        assertEquals("frames:matches",
-                res.at("/query/operands/0/frames/1").asText());
+                res.at("/query/operation").asText());
+        assertEquals(2, res.at("/query/frames").size());
+        assertEquals("frames:alignsLeft", res.at("/query/frames/0").asText());
+        assertEquals("frames:matches", res.at("/query/frames/1").asText());
+        assertEquals("koral:token", res.at("/query/operands/0/@type").asText());
+        assertEquals("koral:span", res.at("/query/operands/1/@type").asText());
     }
 
-
-    @Test
-    public void testOPINwithExclusionFE_MAX ()
-            throws JsonProcessingException, IOException {
-        query = "wegen #IN(FE,%,MAX) <s>";
-        qs.setQuery(query, "cosmas2");
-        res = mapper.readTree(qs.toJSON());
-
-        assertEquals("operation:merge", res.at("/query/operation").asText());
-        assertEquals("operation:class",
-                res.at("/query/operands/0/operation").asText());
-        assertEquals("classRefCheck:unequals",
-                res.at("/query/operands/0/classRefCheck/0").asText());
-        JsonNode classOperand = res.at("/query/operands/0/operands/0");
-        assertEquals("operation:exclusion",
-                classOperand.at("/operation").asText());
-        assertEquals(1, classOperand.at("/frames").size());
-        assertEquals("frames:matches", classOperand.at("/frames/0").asText());
-    }
-
+    // EM: KorAP always do ALL by default.
     
     @Test
-    @Ignore
-    public void testOPINwithMultipleExclusionN_ALL ()
+    public void testOPINwithExclusionN_ALL ()
             throws JsonProcessingException, IOException {
+        
         query = "wegen #IN(N,ALL,%) <s>";
         qs.setQuery(query, "cosmas2");
         res = mapper.readTree(qs.toJSON());
-        // System.out.println(res.toString());
-        assertEquals("operation:class", res.at("/query/operation").asText());
-        assertEquals("classRefOp:delete", res.at("/query/classRefOp").asText());
-        assertEquals(131, res.at("/query/classIn/0").asInt());
-        assertEquals("classRefCheck:unequals",
-                res.at("/query/operands/0/classRefCheck/0").asText());
-        assertEquals("frames:matches",
-                res.at("/query/operands/0/operands/0/frames/0").asText());
+        assertEquals("koral:group", res.at("/query/@type").asText());
+        assertEquals("operation:exclusion",
+                res.at("/query/operation").asText());
+        assertEquals(1, res.at("/query/frames").size());
+        assertEquals("frames:isWithin", res.at("/query/frames/0").asText());
+        assertEquals("koral:token", res.at("/query/operands/0/@type").asText());
+        assertEquals("koral:span", res.at("/query/operands/1/@type").asText());
     }
 
     @Test
-    @Ignore
-    public void testOPINwithMultipleExclusionFE_ALL ()
+    public void testOPINwithExclusionN_ALL_MAX ()
+            throws JsonProcessingException, IOException {
+        query = "wegen #IN(N,ALL,%,MAX) <s>";
+        qs.setQuery(query, "cosmas2");
+        res = mapper.readTree(qs.toJSON());
+        
+        assertEquals("koral:group", res.at("/query/@type").asText());
+        assertEquals("operation:exclusion",
+                res.at("/query/operation").asText());
+        assertEquals(1, res.at("/query/frames").size());
+        assertEquals("frames:isWithin", res.at("/query/frames/0").asText());
+        assertEquals("koral:token", res.at("/query/operands/0/@type").asText());
+    }
+    
+    @Test
+    public void testOPINwithExclusionFE_ALL ()
             throws JsonProcessingException, IOException {
         query = "wegen #IN(FE,ALL,%) <s>";
         qs.setQuery(query, "cosmas2");
         res = mapper.readTree(qs.toJSON());
         assertEquals("operation:class", res.at("/query/operation").asText());
-        assertEquals("classRefOp:delete", res.at("/query/classRefOp").asText());
-        assertEquals(131, res.at("/query/classIn/0").asInt());
         assertEquals("classRefCheck:unequals",
-                res.at("/query/operands/0/classRefCheck/0").asText());
+                res.at("/query/classRefCheck/0").asText());
+        assertEquals(1, res.at("/query/operands/0/frames").size());
         assertEquals("frames:matches",
-                res.at("/query/operands/0/operands/0/frames/0").asText());
+                res.at("/query/operands/0/frames/0").asText());
     }
 
     @Test
-    public void testOPINwithMultipleExclusionN_ALL_MAX ()
-            throws JsonProcessingException, IOException {
-        query = "wegen #IN(N,ALL,%,MAX) <s>";
-        qs.setQuery(query, "cosmas2");
-        res = mapper.readTree(qs.toJSON());
-    }
-    
-    @Test
-    @Ignore
-    public void testOPINwithMultipleExclusionFE_ALL_MAX ()
+    public void testOPINwithExclusionFE_ALL_MAX ()
             throws JsonProcessingException, IOException {
         query = "wegen #IN(FE,ALL,%,MAX) <s>";
         qs.setQuery(query, "cosmas2");
         res = mapper.readTree(qs.toJSON());
-        assertEquals("operation:merge", res.at("/query/operation").asText());
-        assertEquals("operation:class",
-                res.at("/query/operands/0/operation").asText());
-        assertEquals("classRefOp:delete",
-                res.at("/query/operands/0/classRefOp").asText());
-        assertEquals(131, res.at("/query/operands/0/classIn/0").asInt());
-        assertEquals("classRefCheck:unequals", res
-                .at("/query/operands/0/operands/0/classRefCheck/0").asText());
+        assertEquals("operation:class", res.at("/query/operation").asText());
+        assertEquals("classRefCheck:unequals",
+                res.at("/query/classRefCheck/0").asText());
+        assertEquals(1, res.at("/query/operands/0/frames").size());
         assertEquals("frames:matches",
-                res.at("/query/operands/0/operands/0/operands/0/frames/0")
-                        .asText());
+                res.at("/query/operands/0/frames/0").asText());
     }
 
-
 }
