First attempt to support class numbers from 1 to 255 - 1 is the new default class number
diff --git a/src/test/resources/queries/bsp3.jsonld b/src/test/resources/queries/bsp3.jsonld
index 1a40038..0e76838 100644
--- a/src/test/resources/queries/bsp3.jsonld
+++ b/src/test/resources/queries/bsp3.jsonld
@@ -103,12 +103,12 @@
   "query": {
     "@type": "korap:group", 
     "operation": "operation:submatch", 
-    "classRef": [0],
+    "classRef": [1],
     "operands": [
       {
         "@type": "korap:group", 
         "operation" : "operation:class",
-        "class": 0, 
+        "class": 1, 
         "operands": [
           {
             "@type": "korap:token", 
diff --git a/src/test/resources/queries/bsp4.jsonld b/src/test/resources/queries/bsp4.jsonld
index c5cc7db..3a0c3c4 100644
--- a/src/test/resources/queries/bsp4.jsonld
+++ b/src/test/resources/queries/bsp4.jsonld
@@ -103,7 +103,7 @@
   "query": {
     "@type": "korap:group", 
     "operation": "operation:submatch", 
-    "classRef": [0],
+    "classRef": [1],
     "operands": [
       {
         "@type": "korap:group", 
@@ -112,7 +112,7 @@
           {
             "@type": "korap:group", 
 	    "operation":"operation:class",
-            "class": 0, 
+            "class": 1, 
             "operands": [
               {
                 "@type": "korap:token", 
diff --git a/src/test/resources/queries/bugs/cosmas_boundary.jsonld b/src/test/resources/queries/bugs/cosmas_boundary.jsonld
new file mode 100644
index 0000000..fb0f5ff
--- /dev/null
+++ b/src/test/resources/queries/bugs/cosmas_boundary.jsonld
@@ -0,0 +1,69 @@
+{
+  "@context": "http://ids-mannheim.de/ns/KorAP/json-ld/v0.1/context.jsonld",
+  "query":{
+    "@type" : "korap:reference",
+    "classRef" : [
+      129
+    ],
+    "operands" : [
+      {
+        "@type" : "korap:group",
+        "distances" : [
+          {
+            "@type" : "cosmas:distance",
+            "boundary" : {
+              "@type" : "korap:boundary",
+              "max" : 1,
+              "min" : 0
+            },
+	    "foundry" : "base",
+	    "layer" : "s",
+            "key" : "s",
+
+            "max" : 1,
+            "min" : 0
+          }
+        ],
+        "inOrder" : false,
+        "operands" : [
+          {
+            "@type" : "korap:group",
+            "class" : 129,
+            "classOut" : 129,
+            "operands" : [
+              {
+                "@type" : "korap:token",
+                "wrap" : {
+                  "@type" : "korap:term",
+                  "key" : "Namen",
+                  "layer" : "orth",
+                  "match" : "match:eq"
+                }
+              }
+            ],
+            "operation" : "operation:class"
+          },
+          {
+            "@type" : "korap:group",
+            "class" : 129,
+            "classOut" : 129,
+            "operands" : [
+              {
+                "@type" : "korap:token",
+                "wrap" : {
+                  "@type" : "korap:term",
+                  "key" : "Leben",
+                  "layer" : "orth",
+                  "match" : "match:eq"
+                }
+              }
+            ],
+            "operation" : "operation:class"
+          }
+        ],
+        "operation" : "operation:sequence"
+      }
+    ],
+    "operation" : "operation:focus"
+  }
+}