diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/ClassFilteredSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/ClassFilteredSpans.java
index 0b189d0..b785d2e 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/ClassFilteredSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/ClassFilteredSpans.java
@@ -93,6 +93,7 @@
         int start, end;
         // System.out.println("------------------------");
         for (byte[] payload : firstSpans.getPayload()) {
+            /*
             System.err.println(
                                "** " +
                                payload[0] +
@@ -103,6 +104,7 @@
                                "|" +
                                payload[8] +
                                " **");
+            */
             if (payload[0] == 0) {
                 start = byte2int(payload, 1) + 1;
                 end = byte2int(payload, 5) + 1;
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/ClassSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/ClassSpans.java
index bb49e6a..16878f4 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/ClassSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/ClassSpans.java
@@ -148,6 +148,7 @@
         // Todo: Better allocate using a Factory!
         bb.clear();
         bb.put((byte) 0).putInt(spans.start()).putInt(spans.end()).put(number);
+        /*
         System.err.println(
                            "####################### " + 
                            spans.start() +
@@ -156,6 +157,7 @@
                            ":" +
                            number
                            );
+        */
 
         // Add highlight information as byte array
         classedPayload.add(bb.array());
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/FocusSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/FocusSpans.java
index 10d740c..b134c72 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/FocusSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/FocusSpans.java
@@ -165,12 +165,16 @@
         for (byte[] payload : firstSpans.getPayload()) {
             // No class payload - ignore
             // this may be problematic for other calculated payloads!
+            /*
             if ((!matchTemporaryClass && payload.length == 9)
                     || (matchTemporaryClass && payload.length == 10)) {
-                if (classNumbers.contains(payload[8])) {
+            */
+
+            if (payload[0] == 0) {
+                if (classNumbers.contains(payload[9])) {
                     isClassFound = true;
-                    classStart = byte2int(payload, 0);
-                    classEnd = byte2int(payload, 4);
+                    classStart = byte2int(payload, 1);
+                    classEnd = byte2int(payload, 5);
 
                     if (isStart || classStart < minPos) {
                         minPos = classStart;
@@ -180,12 +184,19 @@
                         maxPos = classEnd;
                     }
                 }
-            }
 
+                if (removeTemporaryClasses) {
+                    continue;
+                };
+            }
+        
+            /*
             if (payload.length == 8
                     || (removeTemporaryClasses && payload.length == 10)) {
                 continue;
             }
+            */
+
             candidateSpan.getPayloads().add(payload.clone());
         }
 
diff --git a/src/main/java/de/ids_mannheim/korap/response/Match.java b/src/main/java/de/ids_mannheim/korap/response/Match.java
index 865cef9..1f2e338 100644
--- a/src/main/java/de/ids_mannheim/korap/response/Match.java
+++ b/src/main/java/de/ids_mannheim/korap/response/Match.java
@@ -221,7 +221,8 @@
         // Reverse to make embedding of highlights correct
         Collections.reverse(payload);
         try {
-            ByteBuffer bb = ByteBuffer.allocate(10);
+
+            ByteBuffer bb = ByteBuffer.allocate(24);
 
             // TODO: REVERSE ITERATOR!
             for (byte[] b : payload) {
@@ -255,20 +256,21 @@
 
                 // Element payload for match!
                 // This MAY BE the correct match
-                else if (b[0] == 64) {
+                else if (b[0] == (byte) 64) {
+
                     bb.put(b);
-                    bb.position(1);
+
 
                     if (this.potentialStartPosChar == -1) {
-                        this.potentialStartPosChar = bb.getInt(0);
+                        this.potentialStartPosChar = bb.getInt(1);
                     }
                     else {
                         if (bb.getInt(0) < this.potentialStartPosChar)
-                            this.potentialStartPosChar = bb.getInt(0);
+                            this.potentialStartPosChar = bb.getInt(1);
                     };
 
                     if (bb.getInt(4) > this.potentialEndPosChar)
-                        this.potentialEndPosChar = bb.getInt(4);
+                        this.potentialEndPosChar = bb.getInt(5);
 
                     if (DEBUG)
                         log.trace("Element payload from {} to {}",
@@ -903,6 +905,7 @@
         if (processed)
             return true;
 
+
         // Relevant details are missing
         if (this.positionsToOffset == null || this.localDocID == -1) {
             log.warn("You have to define "
@@ -1138,6 +1141,7 @@
             sb.append("... ");
 
         for (HighlightCombinatorElement hce : this.snippetArray.list()) {
+
             sb.append(hce.toBrackets(this));
         };
 
diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties
index d99b63c..850a404 100644
--- a/src/main/resources/log4j.properties
+++ b/src/main/resources/log4j.properties
@@ -25,7 +25,7 @@
 
 # Responses:
 # log4j.logger.de.ids_mannheim.korap.server.Node = TRACE, stdout
-log4j.logger.de.ids_mannheim.korap.response.Match = TRACE, stdout
+# log4j.logger.de.ids_mannheim.korap.response.Match = TRACE, stdout
 
 # Index:
 log4j.logger.de.ids_mannheim.korap.KrillIndex = TRACE, stdout
