Fixed sentence extension tests for payload IDs

Change-Id: I95173fdd581f939163a1ec3256667181c444ec82
diff --git a/src/main/java/de/ids_mannheim/korap/index/MultiTermTokenStream.java b/src/main/java/de/ids_mannheim/korap/index/MultiTermTokenStream.java
index 4b363dd..02f0d5e 100644
--- a/src/main/java/de/ids_mannheim/korap/index/MultiTermTokenStream.java
+++ b/src/main/java/de/ids_mannheim/korap/index/MultiTermTokenStream.java
@@ -419,10 +419,6 @@
             
             payload.put(mt.payload.bytes);
 
-            if (payload.position() > 18) {
-                System.err.println(mt.toString() + " has " + payload.toString());
-            };
-
             if (DEBUG)
                 log.trace("Create payload[1] {}", payload.toString());
         };
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 9bbef70..2027ab5 100644
--- a/src/main/java/de/ids_mannheim/korap/response/Match.java
+++ b/src/main/java/de/ids_mannheim/korap/response/Match.java
@@ -786,7 +786,7 @@
 
         try {
             // Store character offsets in ByteBuffer
-            ByteBuffer bb = ByteBuffer.allocate(8);
+            ByteBuffer bb = ByteBuffer.allocate(24);
 
             SpanElementQuery cquery = new SpanElementQuery(field, element);
 
@@ -797,7 +797,7 @@
             int newStartChar = -1, newEndChar = -1;
 
             if (DEBUG)
-                log.trace("Extend match to context boundary with {} in {}",
+                log.trace("Extend match to context boundary with {} in docID {}",
                         cquery.toString(), this.localDocID);
 
             while (true) {
@@ -831,18 +831,19 @@
                             for (byte[] b : contextSpans.getPayload()) {
 
                                 // Not an element span
-                                if (b.length != 8)
+                                if (b[0] != (byte) 64)
                                     continue;
 
-                                bb.put(b);
                                 bb.rewind();
+                                bb.put(b);
+                                bb.position(1);
                                 newStartChar = bb.getInt();
                                 newEndChar = bb.getInt();
                                 break;
                             };
                         }
                         catch (Exception e) {
-                            log.warn(e.getMessage());
+                            log.warn("Some problems with ByteBuffer: " + e.getMessage());
                         };
                     };
                 }
@@ -862,11 +863,12 @@
                             for (byte[] b : contextSpans.getPayload()) {
 
                                 // Not an element span
-                                if (b.length != 8)
+                                if (b[0] != (byte) 64)
                                     continue;
 
-                                bb.put(b);
                                 bb.rewind();
+                                bb.put(b);
+                                bb.position(1);
                                 newEndChar = bb.getInt(1);
                                 break;
                             };
diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties
index 850a404..5fed33b 100644
--- a/src/main/resources/log4j.properties
+++ b/src/main/resources/log4j.properties
@@ -1,4 +1,4 @@
-# log4j.rootLogger = ERROR, stdout
+log4j.rootLogger = ERROR, stdout
 
 # Queries:
 # log4j.logger.de.ids_mannheim.korap.query.SpanNextQuery = TRACE, stdout
@@ -28,7 +28,7 @@
 # log4j.logger.de.ids_mannheim.korap.response.Match = TRACE, stdout
 
 # Index:
-log4j.logger.de.ids_mannheim.korap.KrillIndex = TRACE, stdout
+# log4j.logger.de.ids_mannheim.korap.KrillIndex = TRACE, stdout
 # log4j.logger.de.ids_mannheim.korap.index.PositionsToOffset = TRACE, stdout
 # log4j.logger.de.ids_mannheim.korap.index.MultiTermTokenStream = TRACE, stdout