Updated payloads in tests.

Change-Id: I5a2083166e676a1fe7adb08dd6854eaffd59074a
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestClassIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestClassIndex.java
index 42b56b6..c44e4fd 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestClassIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestClassIndex.java
@@ -1,31 +1,20 @@
 package de.ids_mannheim.korap.index;
 
-import java.util.*;
-import java.io.*;
+import static org.junit.Assert.assertEquals;
 
-import org.apache.lucene.util.Version;
-import org.apache.lucene.util.BytesRef;
-import org.apache.lucene.util.Bits;
+import java.io.IOException;
 
-import static org.junit.Assert.*;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.search.spans.SpanQuery;
+import org.apache.lucene.search.spans.SpanTermQuery;
 import org.junit.Test;
-import org.junit.Ignore;
 import org.junit.runner.RunWith;
 import org.junit.runners.JUnit4;
 
 import de.ids_mannheim.korap.KrillIndex;
-import de.ids_mannheim.korap.KrillQuery;
-import de.ids_mannheim.korap.response.Result;
-import de.ids_mannheim.korap.query.SpanNextQuery;
 import de.ids_mannheim.korap.query.SpanClassQuery;
-import de.ids_mannheim.korap.query.SpanElementQuery;
-import de.ids_mannheim.korap.query.SpanWithinQuery;
-import de.ids_mannheim.korap.index.FieldDocument;
-import de.ids_mannheim.korap.index.MultiTermTokenStream;
-
-import org.apache.lucene.search.spans.SpanQuery;
-import org.apache.lucene.search.spans.SpanTermQuery;
-import org.apache.lucene.index.Term;
+import de.ids_mannheim.korap.query.SpanNextQuery;
+import de.ids_mannheim.korap.response.Result;
 
 // mvn -Dtest=TestWithinIndex#indexExample1 test
 
@@ -38,12 +27,12 @@
 
         // abcabcabac
         FieldDocument fd = new FieldDocument();
-        fd.addTV("base", "abcabcabac", "[(0-1)s:a|i:a|_0#0-1|-:t$<i>10]"
-                + "[(1-2)s:b|i:b|_1#1-2]" + "[(2-3)s:c|i:c|_2#2-3]"
-                + "[(3-4)s:a|i:a|_3#3-4]" + "[(4-5)s:b|i:b|_4#4-5]"
-                + "[(5-6)s:c|i:c|_5#5-6]" + "[(6-7)s:a|i:a|_6#6-7]"
-                + "[(7-8)s:b|i:b|_7#7-8]" + "[(8-9)s:a|i:a|_8#8-9]"
-                + "[(9-10)s:c|i:c|_9#9-10]");
+        fd.addTV("base", "abcabcabac", "[(0-1)s:a|i:a|_0$<i>0<i>1|-:t$<i>10]"
+                + "[(1-2)s:b|i:b|_1$<i>1<i>2]" + "[(2-3)s:c|i:c|_2$<i>2<i>3]"
+                + "[(3-4)s:a|i:a|_3$<i>3<i>4]" + "[(4-5)s:b|i:b|_4$<i>4<i>5]"
+                + "[(5-6)s:c|i:c|_5$<i>5<i>6]" + "[(6-7)s:a|i:a|_6$<i>6<i>7]"
+                + "[(7-8)s:b|i:b|_7$<i>7<i>8]" + "[(8-9)s:a|i:a|_8$<i>8<i>9]"
+                + "[(9-10)s:c|i:c|_9$<i>9<i>10]");
         ki.addDoc(fd);
 
         ki.commit();
@@ -244,12 +233,12 @@
 
         // abcabcabac
         FieldDocument fd = new FieldDocument();
-        fd.addTV("base", "abcabcabac", "[(0-1)s:a|i:a|_0#0-1|-:t$<i>10]"
-                + "[(1-2)s:b|i:b|_1#1-2]" + "[(2-3)s:c|i:c|_2#2-3]"
-                + "[(3-4)s:a|i:a|_3#3-4|<>:x#3-7$<i>7]"
-                + "[(4-5)s:b|i:b|_4#4-5]" + "[(5-6)s:c|i:c|_5#5-6]"
-                + "[(6-7)s:a|i:a|_6#6-7]" + "[(7-8)s:b|i:b|_7#7-8]"
-                + "[(8-9)s:a|i:a|_8#8-9]" + "[(9-10)s:c|i:c|_9#9-10]");
+        fd.addTV("base", "abcabcabac", "[(0-1)s:a|i:a|_0$<i>0<i>1|-:t$<i>10]"
+                + "[(1-2)s:b|i:b|_1$<i>1<i>2]" + "[(2-3)s:c|i:c|_2$<i>2<i>3]"
+                + "[(3-4)s:a|i:a|_3$<i>3<i>4|<>:x$<b>64<i>3<i>7<i>7]"
+                + "[(4-5)s:b|i:b|_4$<i>4<i>5]" + "[(5-6)s:c|i:c|_5$<i>5<i>6]"
+                + "[(6-7)s:a|i:a|_6$<i>6<i>7]" + "[(7-8)s:b|i:b|_7$<i>7<i>8]"
+                + "[(8-9)s:a|i:a|_8$<i>8<i>9]" + "[(9-10)s:c|i:c|_9$<i>9<i>10]");
         ki.addDoc(fd);
 
         ki.commit();
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestDistanceExclusionIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestDistanceExclusionIndex.java
index 8f61549..dbc3b72 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestDistanceExclusionIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestDistanceExclusionIndex.java
@@ -178,15 +178,16 @@
     private FieldDocument createFieldDoc0 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-0");
-        fd.addTV("base", "text", "[(0-1)s:c|_1#0-1]" + "[(1-2)s:e|_2#1-2]"
-				+ "[(2-3)s:c|_3#2-3|<>:y$<b>64<i>2<i>4<i>4]"
-				+ "[(3-4)s:c|_4#3-4|<>:x$<b>64<i>3<i>7<i>7]"
-				+ "[(4-5)s:d|_5#4-5|<>:y$<b>64<i>4<i>6<i>6]"
-				+ "[(5-6)s:c|_6#5-6|<>:y$<b>64<i>5<i>8<i>8]"
-				+ "[(6-7)s:d|_7#6-7]"
-				+ "[(7-8)s:e|_8#7-8|<>:x$<b>64<i>7<i>9<i>9]"
-				+ "[(8-9)s:e|_9#8-9]"
-				+ "[(9-10)s:d|_10#9-10|<>:x$<b>64<i>9<i>10<i>10]");
+        fd.addTV("base", "text", "[(0-1)s:c|_1$<i>0<i>1]"
+                + "[(1-2)s:e|_2$<i>1<i>2]"
+                + "[(2-3)s:c|_3$<i>2<i>3|<>:y$<b>64<i>2<i>4<i>4<b>0]"
+                + "[(3-4)s:c|_4$<i>3<i>4|<>:x$<b>64<i>3<i>7<i>7<b>0]"
+                + "[(4-5)s:d|_5$<i>4<i>5|<>:y$<b>64<i>4<i>6<i>6<b>0]"
+                + "[(5-6)s:c|_6$<i>5<i>6|<>:y$<b>64<i>5<i>8<i>8<b>0]"
+                + "[(6-7)s:d|_7$<i>6<i>7]"
+                + "[(7-8)s:e|_8$<i>7<i>8|<>:x$<b>64<i>7<i>9<i>9<b>0]"
+                + "[(8-9)s:e|_9$<i>8<i>9]"
+                + "[(9-10)s:d|_10$<i>9<i>10|<>:x$<b>64<i>9<i>10<i>10<b>0]");
         return fd;
     }
 
@@ -194,9 +195,10 @@
     private FieldDocument createFieldDoc1 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-1");
-        fd.addTV("base", "text", "[(0-1)s:b|s:c|_1#0-1]" + "[(1-2)s:b|_2#1-2]"
-                + "[(2-3)s:c|_3#2-3]" + "[(3-4)s:c|_4#3-4]"
-                + "[(4-5)s:d|_5#4-5]" + "[(5-6)s:d|_6#5-6]");
+        fd.addTV("base", "text", "[(0-1)s:b|s:c|_1$<i>0<i>1]"
+                + "[(1-2)s:b|_2$<i>1<i>2]" + "[(2-3)s:c|_3$<i>2<i>3]"
+                + "[(3-4)s:c|_4$<i>3<i>4]" + "[(4-5)s:d|_5$<i>4<i>5]"
+                + "[(5-6)s:d|_6$<i>5<i>6]");
         return fd;
     }
 
@@ -204,11 +206,12 @@
     private FieldDocument createFieldDoc2 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-2");
-        fd.addTV("base", "text", "[(0-1)s:b|_1#0-1]" + "[(1-2)s:b|_2#1-2]"
-                + "[(2-3)s:c|_3#2-3]" + "[(3-4)s:c|_4#3-4]"
-                + "[(4-5)s:b|_5#4-5]" + "[(5-6)s:d|_6#5-6]"
-                + "[(6-7)s:b|_7#6-7]" + "[(7-8)s:d|_8#7-8]"
-                + "[(8-9)s:c|_9#8-9]" + "[(9-10)s:d|_10#9-10]");
+        fd.addTV("base", "text", "[(0-1)s:b|_1$<i>0<i>1]"
+                + "[(1-2)s:b|_2$<i>1<i>2]" + "[(2-3)s:c|_3$<i>2<i>3]"
+                + "[(3-4)s:c|_4$<i>3<i>4]" + "[(4-5)s:b|_5$<i>4<i>5]"
+                + "[(5-6)s:d|_6$<i>5<i>6]" + "[(6-7)s:b|_7$<i>6<i>7]"
+                + "[(7-8)s:d|_8$<i>7<i>8]" + "[(8-9)s:c|_9$<i>8<i>9]"
+                + "[(9-10)s:d|_10$<i>9<i>10]");
         return fd;
     }
 
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestDistanceIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestDistanceIndex.java
index 72af862..39d2392 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestDistanceIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestDistanceIndex.java
@@ -40,13 +40,13 @@
         fd.addString("ID", "doc-1");
         fd.addTV("base", "text", "[(0-1)s:c|_1$<i>0<i>1]"
                 + "[(1-2)s:e|_2$<i>1<i>2]"
-                + "[(2-3)s:c|_3$<i>2<i>3|<>:y$<b>64<i>2<i>4<i>4]"
-                + "[(3-4)s:c|_4$<i>3<i>4|<>:x$<b>64<i>3<i>7<i>7]"
-                + "[(4-5)s:d|_5$<i>4<i>5|<>:y$<b>64<i>4<i>6<i>6]"
-                + "[(5-6)s:c|_6$<i>5<i>6|<>:y$<b>64<i>5<i>8<i>8]"
+                + "[(2-3)s:c|_3$<i>2<i>3|<>:y$<b>64<i>2<i>4<i>4<b>0]"
+                + "[(3-4)s:c|_4$<i>3<i>4|<>:x$<b>64<i>3<i>7<i>7<b>0]"
+                + "[(4-5)s:d|_5$<i>4<i>5|<>:y$<b>64<i>4<i>6<i>6<b>0]"
+                + "[(5-6)s:c|_6$<i>5<i>6|<>:y$<b>64<i>5<i>8<i>8<b>0]"
                 + "[(6-7)s:d|_7$<i>6<i>7]"
-                + "[(7-8)s:e|_8$<i>7<i>8|<>:x$<b>64<i>7<i>9<i>9]"
-                + "[(8-9)s:e|_9$<i>8<i>9|<>:x$<b>64<i>8<i>10<i>10]"
+                + "[(7-8)s:e|_8$<i>7<i>8|<>:x$<b>64<i>7<i>9<i>9<b>0]"
+                + "[(8-9)s:e|_9$<i>8<i>9|<>:x$<b>64<i>8<i>10<i>10<b>0]"
                 + "[(9-10)s:d|_10$<i>9<i>10]");
         return fd;
     }
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceExclusionIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceExclusionIndex.java
index fafb308..23b6ac8 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceExclusionIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceExclusionIndex.java
@@ -37,14 +37,14 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-0");
         fd.addTV("base", "ceccdcdecd",
-                "[(0-1)s:c|_1$<i>0<i>1|<>:s$<b>64<i>0<i>1<i>1]"
-                        + "[(1-2)s:e|_2$<i>1<i>2|<>:s$<b>64<i>1<i>2<i>2]"
-                        + "[(2-3)s:c|_3$<i>2<i>3|<>:s$<b>64<i>2<i>4<i>4]"
+                "[(0-1)s:c|_1$<i>0<i>1|<>:s$<b>64<i>0<i>1<i>1<b>0]"
+                        + "[(1-2)s:e|_2$<i>1<i>2|<>:s$<b>64<i>1<i>2<i>2<b>0]"
+                        + "[(2-3)s:c|_3$<i>2<i>3|<>:s$<b>64<i>2<i>4<i>4<b>0]"
                         + "[(3-4)s:c|_4$<i>3<i>4]"
-                        + "[(4-5)s:d|_5$<i>4<i>5|<>:s$<b>64<i>4<i>6<i>6]"
+                        + "[(4-5)s:d|_5$<i>4<i>5|<>:s$<b>64<i>4<i>6<i>6<b>0]"
                         + "[(5-6)s:c|_6$<i>5<i>6]"
-                        + "[(6-7)s:d|_7$<i>6<i>7|<>:s$<b>64<i>6<i>7<i>7]"
-                        + "[(7-8)s:e|_8$<i>7<i>8|<>:s$<b>64<i>7<i>9<i>9]"
+                        + "[(6-7)s:d|_7$<i>6<i>7|<>:s$<b>64<i>6<i>7<i>7<b>0]"
+                        + "[(7-8)s:e|_8$<i>7<i>8|<>:s$<b>64<i>7<i>9<i>9<b>0]"
                         + "[(8-9)s:c|_9$<i>8<i>9]"
                         + "[(9-10)s:d|_10$<i>9<i>10]");
         return fd;
@@ -55,13 +55,13 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-1");
         fd.addTV("base", "eedadaeed",
-                "[(0-1)s:e|_1$<i>0<i>1|<>:s$<b>64<i>0<i>1<i>1]"
-                        + "[(1-2)s:e|_2$<i>1<i>2|<>:s$<b>64<i>1<i>2<i>2]"
-                        + "[(2-3)s:d|_3$<i>2<i>3|<>:s$<b>64<i>2<i>4<i>4]"
+                "[(0-1)s:e|_1$<i>0<i>1|<>:s$<b>64<i>0<i>1<i>1<b>0]"
+                        + "[(1-2)s:e|_2$<i>1<i>2|<>:s$<b>64<i>1<i>2<i>2<b>0]"
+                        + "[(2-3)s:d|_3$<i>2<i>3|<>:s$<b>64<i>2<i>4<i>4<b>0]"
                         + "[(3-4)s:a|_4$<i>3<i>4]"
-                        + "[(4-5)s:d|_5$<i>4<i>5|<>:s$<b>64<i>4<i>7<i>6]"
+                        + "[(4-5)s:d|_5$<i>4<i>5|<>:s$<b>64<i>4<i>7<i>6<b>0]"
                         + "[(5-6)s:a|_6$<i>5<i>6]"
-                        + "[(6-7)s:e|_7$<i>6<i>7|<>:s$<b>64<i>6<i>7<i>9]"
+                        + "[(6-7)s:e|_7$<i>6<i>7|<>:s$<b>64<i>6<i>7<i>9<b>0]"
                         + "[(7-8)s:e|_8$<i>7<i>8]" + "[(8-9)s:d|_9$<i>8<i>9]");
         return fd;
     }
@@ -71,14 +71,14 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-");
         fd.addTV("base", "dcacacdac",
-                "[(0-1)s:d|_1$<i>0<i>1|<>:s$<b>64<i>0<i>1<i>1]"
-                        + "[(1-2)s:c|_2$<i>1<i>2|<>:s$<b>64<i>1<i>2<i>2]"
-                        + "[(2-3)s:a|_3$<i>2<i>3|<>:s$<b>64<i>2<i>4<i>4]"
+                "[(0-1)s:d|_1$<i>0<i>1|<>:s$<b>64<i>0<i>1<i>1<b>0]"
+                        + "[(1-2)s:c|_2$<i>1<i>2|<>:s$<b>64<i>1<i>2<i>2<b>0]"
+                        + "[(2-3)s:a|_3$<i>2<i>3|<>:s$<b>64<i>2<i>4<i>4<b>0]"
                         + "[(3-4)s:c|_4$<i>3<i>4]"
-                        + "[(4-5)s:a|_5$<i>4<i>5|<>:s$<b>64<i>4<i>6<i>6]"
+                        + "[(4-5)s:a|_5$<i>4<i>5|<>:s$<b>64<i>4<i>6<i>6<b>0]"
                         + "[(5-6)s:c|_6$<i>5<i>6]"
-                        + "[(6-7)s:d|_7$<i>6<i>7|<>:s$<b>64<i>6<i>7<i>7]"
-                        + "[(7-8)s:a|_8$<i>7<i>8|<>:s$<b>64<i>7<i>9<i>9]"
+                        + "[(6-7)s:d|_7$<i>6<i>7|<>:s$<b>64<i>6<i>7<i>7<b>0]"
+                        + "[(7-8)s:a|_8$<i>7<i>8|<>:s$<b>64<i>7<i>9<i>9<b>0]"
                         + "[(8-9)s:c|_9$<i>8<i>9]");
         return fd;
     }
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceIndex.java
index 447c1b0..86056c0 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceIndex.java
@@ -37,11 +37,11 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-0");
         fd.addTV("base", "text",
-                "[(0-1)s:b|s:c|_1$<i>0<i>1|<>:s$<b>64<i>0<i>1<i>1]"
+                "[(0-1)s:b|s:c|_1$<i>0<i>1|<>:s$<b>64<i>0<i>1<i>1<b>0]"
                         + "[(1-2)s:b|_2$<i>1<i>2]"
-                        + "[(2-3)s:c|_3$<i>2<i>3|<>:s$<b>64<i>2<i>3<i>3]"
-                        + "[(3-4)s:b|_4$<i>3<i>4|<>:s$<b>64<i>3<i>4<i>4]"
-                        + "[(4-5)s:b|_5$<i>4<i>5|<>:s$<b>64<i>4<i>5<i>5]"
+                        + "[(2-3)s:c|_3$<i>2<i>3|<>:s$<b>64<i>2<i>3<i>3<b>0]"
+                        + "[(3-4)s:b|_4$<i>3<i>4|<>:s$<b>64<i>3<i>4<i>4<b>0]"
+                        + "[(4-5)s:b|_5$<i>4<i>5|<>:s$<b>64<i>4<i>5<i>5<b>0]"
                         + "[(5-6)s:b|_6$<i>5<i>6]" + "[(6-7)s:c|_7$<i>6<i>7]");
         return fd;
     }
@@ -51,12 +51,12 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-1");
         fd.addTV("base", "text",
-                "[(0-1)s:e|_1$<i>0<i>1|<>:s$<b>64<i>0<i>2<i>1]"
-                        + "[(1-2)s:c|s:b|_2$<i>1<i>2|<>:s$<b>64<i>1<i>2<i>2]"
-                        + "[(2-3)s:e|_3$<i>2<i>3|<>:s$<b>64<i>2<i>3<i>3]"
-                        + "[(3-4)s:b|_4$<i>3<i>4|<>:s$<b>64<i>3<i>4<i>4]"
-                        + "[(4-5)s:d|_5$<i>4<i>5|<>:s$<b>64<i>4<i>5<i>5]"
-                        + "[(5-6)s:c|_6$<i>5<i>6|<>:s$<b>64<i>5<i>6<i>6]");
+                "[(0-1)s:e|_1$<i>0<i>1|<>:s$<b>64<i>0<i>2<i>1<b>0]"
+                        + "[(1-2)s:c|s:b|_2$<i>1<i>2|<>:s$<b>64<i>1<i>2<i>2<b>0]"
+                        + "[(2-3)s:e|_3$<i>2<i>3|<>:s$<b>64<i>2<i>3<i>3<b>0]"
+                        + "[(3-4)s:b|_4$<i>3<i>4|<>:s$<b>64<i>3<i>4<i>4<b>0]"
+                        + "[(4-5)s:d|_5$<i>4<i>5|<>:s$<b>64<i>4<i>5<i>5<b>0]"
+                        + "[(5-6)s:c|_6$<i>5<i>6|<>:s$<b>64<i>5<i>6<i>6<b>0]");
         return fd;
     }
 
@@ -65,11 +65,11 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-2");
         fd.addTV("base", "text",
-                "[(0-1)s:b|_1$<i>0<i>1|<>:p$<b>64<i>0<i>2<i>1]"
+                "[(0-1)s:b|_1$<i>0<i>1|<>:p$<b>64<i>0<i>2<i>1<b>0]"
                         + "[(1-2)s:b|_2$<i>1<i>2]"
-                        + "[(2-3)s:b|_3$<i>2<i>3|<>:p$<b>64<i>2<i>3<i>3]"
-                        + "[(3-4)s:d|_4$<i>3<i>4|<>:p$<b>64<i>3<i>4<i>4]"
-                        + "[(4-5)s:d|_5$<i>4<i>5|<>:p$<b>64<i>4<i>5<i>5]"
+                        + "[(2-3)s:b|_3$<i>2<i>3|<>:p$<b>64<i>2<i>3<i>3<b>0]"
+                        + "[(3-4)s:d|_4$<i>3<i>4|<>:p$<b>64<i>3<i>4<i>4<b>0]"
+                        + "[(4-5)s:d|_5$<i>4<i>5|<>:p$<b>64<i>4<i>5<i>5<b>0]"
                         + "[(5-6)s:d|_6$<i>5<i>6]");
         return fd;
     }
@@ -79,11 +79,11 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-3");
         fd.addTV("base", "text",
-                "[(0-1)s:b|_1$<i>0<i>1|<>:s$<b>64<i>0<i>2<i>1]"
+                "[(0-1)s:b|_1$<i>0<i>1|<>:s$<b>64<i>0<i>2<i>1<b>0]"
                         + "[(1-2)s:d|_2$<i>1<i>2]"
-                        + "[(2-3)s:b|_3$<i>2<i>3|<>:s$<b>64<i>2<i>3<i>3]"
-                        + "[(3-4)s:c|_4$<i>3<i>4|<>:s$<b>64<i>3<i>4<i>4]"
-                        + "[(4-5)s:d|_5$<i>4<i>5|<>:s$<b>64<i>4<i>5<i>5]"
+                        + "[(2-3)s:b|_3$<i>2<i>3|<>:s$<b>64<i>2<i>3<i>3<b>0]"
+                        + "[(3-4)s:c|_4$<i>3<i>4|<>:s$<b>64<i>3<i>4<i>4<b>0]"
+                        + "[(4-5)s:d|_5$<i>4<i>5|<>:s$<b>64<i>4<i>5<i>5<b>0]"
                         + "[(5-6)s:d|_6$<i>5<i>6]");
         return fd;
     }
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestElementIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestElementIndex.java
index 71feb94..96a1d70 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestElementIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestElementIndex.java
@@ -26,9 +26,10 @@
         // <a>x<a>y<a>zhij</a>hij</a>hij</a>hij</a>
         FieldDocument fd = new FieldDocument();
         fd.addTV("base", "x  y  z  h  i  j  h  i  j  h  i  j  ",
-                "[(0-3)s:x|<>:a$<b>64<i>0<i>3<i>12]"
-                        + "[(3-6)s:y|<>:a$<b>64<i>3<i>6<i>9]"
-                        + "[(6-9)s:z|<>:a$<b>64<i>6<i>9<i>6]" + "[(9-12)s:h]"
+                "[(0-3)s:x|<>:a$<b>64<i>0<i>3<i>12<b>0]"
+                        + "[(3-6)s:y|<>:a$<b>64<i>3<i>6<i>9<b>0]"
+                        + "[(6-9)s:z|<>:a$<b>64<i>6<i>9<i>6]"
+                        + "[(9-12)s:h<b>0]"
                         + "[(12-15)s:i]" + "[(15-18)s:j]" + "[(18-21)s:h]"
                         + "[(21-24)s:i]" + "[(24-27)s:j]" + "[(27-30)s:h]"
                         + "[(30-33)s:i]" + "[(33-36)s:j]");
@@ -37,9 +38,10 @@
         // <a>x<a>y<a>zcde</a>cde</a>cde</a>cde</a>
         fd = new FieldDocument();
         fd.addTV("base", "x  y  z  c  d  e  c  d  e  c  d  e  ",
-                "[(0-3)s:x|<>:a$<b>64<i>0<i>3<i>12]"
-                        + "[(3-6)s:y|<>:a$<b>64<i>3<i>6<i>9]"
-                        + "[(6-9)s:z|<>:a$<b>64<i>6<i>9<i>6]" + "[(9-12)s:c]"
+                "[(0-3)s:x|<>:a$<b>64<i>0<i>3<i>12<b>0]"
+                        + "[(3-6)s:y|<>:a$<b>64<i>3<i>6<i>9<b>0]"
+                        + "[(6-9)s:z|<>:a$<b>64<i>6<i>9<i>6]"
+                        + "[(9-12)s:c<b>0]"
                         + "[(12-15)s:d]" + "[(15-18)s:e]" + "[(18-21)s:c]"
                         + "[(21-24)s:d]" + "[(24-27)s:e]" + "[(27-30)s:c]"
                         + "[(30-33)s:d]" + "[(33-36)s:e]");
@@ -82,9 +84,9 @@
         FieldDocument fd = new FieldDocument();
         fd.addTV("base", "h  h        i  j   h  i  j  h  i  j  ",
                 "[(0-3)s:h|"
-                + "<>:a$<b>64<i>0<i>18<i>3|" 
-                + "<>:a$<b>64<i>0<i>27<i>6|"
-                + "<>:a$<b>64<i>0<i>36<i>9]" + "[(3-6)s:h]" + "[(12-15)s:i]"
+                + "<>:a$<b>64<i>0<i>18<i>3<b>0|"
+                + "<>:a$<b>64<i>0<i>27<i>6<b>0|" + "<>:a$<b>64<i>0<i>36<i>9]"
+                + "[(3-6)s:h]" + "[(12-15)s:i<b>0]"
                 + "[(15-18)s:j]" + "[(18-21)s:h]" + "[(21-24)s:i]"
                 + "[(24-27)s:j]" + "[(27-30)s:h]" + "[(30-33)s:i]"
                 + "[(33-36)s:j]");
@@ -116,15 +118,18 @@
         // <a><a><a>u</a></a></a>
         FieldDocument fd = new FieldDocument();
         fd.addTV("base", "xyz",
-                "[(0-3)s:xyz|<>:a$<b>64<i>0<i>3<i>0|<>:a$<b>64<i>0<i>3<i>0|<>:a$<b>64<i>0<i>3<i>0|<>:b$<b>64<i>0<i>3<i>0]");
+ "[(0-3)s:xyz|<>:a$<b>64<i>0<i>3<i>0<b>0|"
+                + "<>:a$<b>64<i>0<i>3<i>0<b>0|"
+                + "<>:a$<b>64<i>0<i>3<i>0<b>0|<>:b$<b>64<i>0<i>3<i>0<b>0]");
         ki.addDoc(fd);
 
         // <a><b>x<a>y<a>zcde</a>cde</a>cde</b></a>
         fd = new FieldDocument();
         fd.addTV("base", "x  y  z  c  d  e  c  d  e  c  d  e  ",
-                "[(0-3)s:x|<>:a$<b>64<i>0<i>36<i>12|<>:b$<b>64<i>0<i>36<i>12]"
-                        + "[(3-6)s:y|<>:a$<b>64<i>3<i>27<i>9]"
-                        + "[(6-9)s:z|<>:a$<b>64<i>6<i>18<i>6]" + "[(9-12)s:c]"
+                "[(0-3)s:x|<>:a$<b>64<i>0<i>36<i>12<b>0|<>:b$<b>64<i>0<i>36<i>12<b>0]"
+                        + "[(3-6)s:y|<>:a$<b>64<i>3<i>27<i>9<b>0]"
+                        + "[(6-9)s:z|<>:a$<b>64<i>6<i>18<i>6]"
+                        + "[(9-12)s:c<b>0]"
                         + "[(12-15)s:d]" + "[(15-18)s:e]" + "[(18-21)s:c]"
                         + "[(21-24)s:d]" + "[(24-27)s:e]" + "[(27-30)s:c]"
                         + "[(30-33)s:d]" + "[(33-36)s:e]");
@@ -139,9 +144,10 @@
         // <a>x<a><b>y<a>zcde</a>cde</b></a>cde</a>
         fd = new FieldDocument();
         fd.addTV("base", "x  y  z  k  l  m  k  l  m  k  l  m  ",
-                "[(0-3)s:x|<>:a$<b>64<i>0<i>3<i>12]"
-                        + "[(3-6)s:y|<>:a$<b>64<i>3<i>6<i>9|<>:b$<b>64<i>3<i>6<i>9]"
-                        + "[(6-9)s:z|<>:a$<b>64<i>6<i>9<i>6]" + "[(9-12)s:k]"
+                "[(0-3)s:x|<>:a$<b>64<i>0<i>3<i>12<b>0]"
+                        + "[(3-6)s:y|<>:a$<b>64<i>3<i>6<i>9<b>0|<>:b$<b>64<i>3<i>6<i>9<b>0]"
+                        + "[(6-9)s:z|<>:a$<b>64<i>6<i>9<i>6<b>0]"
+                        + "[(9-12)s:k<b>0]"
                         + "[(12-15)s:l]" + "[(15-18)s:m]" + "[(18-21)s:k]"
                         + "[(21-24)s:l]" + "[(24-27)s:m]" + "[(27-30)s:k]"
                         + "[(30-33)s:l]" + "[(33-36)s:m]");
@@ -151,9 +157,9 @@
         fd = new FieldDocument();
         fd.addTV("base", "h  h        i  j  h  i  j  h  i  j  ",
                 "[(0-3)s:h|" 
-                        + "<>:a$<b>64<i>0<i>18<i>3|" 
-                        + "<>:a$<b>64<i>0<i>27<i>6|" 
-                        + "<>:a$<b>64<i>0<i>36<i>9]"
+                + "<>:a$<b>64<i>0<i>18<i>3<b>0|"
+                + "<>:a$<b>64<i>0<i>27<i>6<b>0|"
+                + "<>:a$<b>64<i>0<i>36<i>9<b>0]"
                         + "[(3-6)s:h]" + "[(12-15)s:i]" + "[(15-18)s:j]"
                         + "[(18-21)s:h]" + "[(21-24)s:i]" + "[(24-27)s:j]"
                         + "[(27-30)s:h]" + "[(30-33)s:i]" + "[(33-36)s:j]");
@@ -217,10 +223,10 @@
         fd.addTV("base", "111111ccc222222fff333333iiijjj",
                 "[(0-3)s:a|_0$<i>0<i>3]" + "[(3-6)s:b|_1$<i>3<i>6]"
                         + "[(6-9)s:c|_2$<i>6<i>9]"
-                        + "[(9-12)s:d|_3$<i>9<i>12|<>:a$<b>64<i>9<i>15<i>4]"
+                        + "[(9-12)s:d|_3$<i>9<i>12|<>:a$<b>64<i>9<i>15<i>4<b>0]"
                         + "[(12-15)s:e|_4$<i>12<i>15]"
                         + "[(15-18)s:f|_5$<i>15<i>18]"
-                        + "[(18-21)s:g|_6$<i>18<i>21|<>:a$<b>64<i>18<i>24<i>8]"
+                        + "[(18-21)s:g|_6$<i>18<i>21|<>:a$<b>64<i>18<i>24<i>8<b>0]"
                         + "[(21-24)s:h|_7$<i>21<i>24]"
                         + "[(24-27)s:i|_8$<i>24<i>27]"
                         + "[(27-30)s:j|_9$<i>27<i>30]");
@@ -249,12 +255,12 @@
 
         FieldDocument fd = new FieldDocument();
         fd.addTV("base", "111111ccc222222fff333333iiijjj",
-                "[(0-3)s:a|_0$<i>0<i>3|<>:a$<b>64<i>0<i>6<i>1]"
+                "[(0-3)s:a|_0$<i>0<i>3|<>:a$<b>64<i>0<i>6<i>1<b>0]"
                         + "[(3-6)s:b|_1$<i>3<i>6]" + "[(6-9)s:c|_2$<i>6<i>9]"
-                        + "[(9-12)s:d|_3$<i>9<i>12|<>:a$<b>64<i>9<i>15<i>4]"
+                        + "[(9-12)s:d|_3$<i>9<i>12|<>:a$<b>64<i>9<i>15<i>4<b>0]"
                         + "[(12-15)s:e|_4$<i>12<i>15]"
                         + "[(15-18)s:f|_5$<i>15<i>18]"
-                        + "[(18-21)s:g|_6$<i>18<i>21|<>:a$<b>64<i>18<i>24<i>8]"
+                        + "[(18-21)s:g|_6$<i>18<i>21|<>:a$<b>64<i>18<i>24<i>8<b>0]"
                         + "[(21-24)s:h|_7$<i>21<i>24]"
                         + "[(24-27)s:i|_8$<i>24<i>27]"
                         + "[(27-30)s:j|_9$<i>27<i>30]");
@@ -286,9 +292,9 @@
         // <a>x<a>y<a>zhij</a>hij</a>hij</a>
         FieldDocument fd = new FieldDocument();
         fd.addTV("base", "x  y  z  h  i  j  h  i  j  h  i  j  ",
-                "[(0-3)s:x|_0$<i>0<i>3|<>:a$<b>64<i>0<i>36<i>12]" + // 1
-                        "[(3-6)s:y|_1$<i>3<i>6|<>:a$<b>64<i>3<i>27<i>9]" + // 2
-                        "[(6-9)s:z|_2$<i>6<i>9|<>:a$<b>64<i>6<i>18<i>6]" + // 3
+                "[(0-3)s:x|_0$<i>0<i>3|<>:a$<b>64<i>0<i>36<i>12<b>0]" + // 1
+                        "[(3-6)s:y|_1$<i>3<i>6|<>:a$<b>64<i>3<i>27<i>9<b>0]" + // 2
+                        "[(6-9)s:z|_2$<i>6<i>9|<>:a$<b>64<i>6<i>18<i>6<b>0]" + // 3
                         "[(9-12)s:h|_3$<i>9<i>12]" + // 4
                         "[(12-15)s:i|_4$<i>12<i>15]" + // 5
                         "[(15-18)s:j|_5$<i>15<i>18]" + // 6
@@ -310,7 +316,7 @@
         // Here is a larger offset than expected
         fd = new FieldDocument();
         fd.addTV("base", "x  y  z  h  ",
-                "[(0-3)s:x|_0$<i>0<i>3|<>:a$<b>64<i>0<i>36<i>12]" + // 1
+                "[(0-3)s:x|_0$<i>0<i>3|<>:a$<b>64<i>0<i>36<i>12<b>0]" + // 1
                         "[(3-6)s:y|_1$<i>3<i>6]" + // 2
                         "[(6-9)s:z|_2$<i>6<i>9]" + // 3
                         "[(9-12)s:h|_3$<i>9<i>12]"); // 4
@@ -319,9 +325,9 @@
         // <a>x<a>y<a>zabc</a>abc</a>abc</a>
         fd = new FieldDocument();
         fd.addTV("base", "x  y  z  a  b  c  a  b  c  a  b  c  ",
-                "[(0-3)s:x|_0$<i>0<i>3|<>:a$<b>64<i>0<i>36<i>12]" + // 1
-                        "[(3-6)s:y|_1$<i>3<i>6|<>:a$<b>64<i>3<i>27<i>9]" + // 2
-                        "[(6-9)s:z|_2$<i>6<i>9|<>:a$<b>64<i>6<i>18<i>6]" + // 3
+                "[(0-3)s:x|_0$<i>0<i>3|<>:a$<b>64<i>0<i>36<i>12<b>0]" + // 1
+                        "[(3-6)s:y|_1$<i>3<i>6|<>:a$<b>64<i>3<i>27<i>9<b>0]" + // 2
+                        "[(6-9)s:z|_2$<i>6<i>9|<>:a$<b>64<i>6<i>18<i>6<b>0]" + // 3
                         "[(9-12)s:a|_3$<i>9<i>12]" + // 4
                         "[(12-15)s:b|_4$<i>12<i>15]" + // 5
                         "[(15-18)s:c|_5$<i>15<i>18]" + // 6
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestFieldDocument.java b/src/test/java/de/ids_mannheim/korap/index/TestFieldDocument.java
index b48b48e..74baae6 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestFieldDocument.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestFieldDocument.java
@@ -1,41 +1,27 @@
 package de.ids_mannheim.korap.index;
 
-import java.util.*;
-import java.io.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
 
-import org.apache.lucene.util.Version;
-import org.apache.lucene.util.BytesRef;
-import org.apache.lucene.util.Bits;
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.IOException;
 
-import static org.junit.Assert.*;
+import org.apache.lucene.search.spans.SpanQuery;
 import org.junit.Test;
-import org.junit.Ignore;
 import org.junit.runner.RunWith;
 import org.junit.runners.JUnit4;
 
-import com.fasterxml.jackson.annotation.*;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import de.ids_mannheim.korap.KrillIndex;
-import de.ids_mannheim.korap.KrillQuery;
-import de.ids_mannheim.korap.response.Result;
 import de.ids_mannheim.korap.Krill;
+import de.ids_mannheim.korap.KrillIndex;
 import de.ids_mannheim.korap.KrillMeta;
-import de.ids_mannheim.korap.response.Match;
-import de.ids_mannheim.korap.query.SpanNextQuery;
-import de.ids_mannheim.korap.query.SpanClassQuery;
+import de.ids_mannheim.korap.KrillQuery;
 import de.ids_mannheim.korap.query.QueryBuilder;
-import de.ids_mannheim.korap.index.FieldDocument;
-import de.ids_mannheim.korap.index.MultiTermTokenStream;
-
 import de.ids_mannheim.korap.query.wrap.SpanQueryWrapper;
-
+import de.ids_mannheim.korap.response.Match;
+import de.ids_mannheim.korap.response.Result;
 import de.ids_mannheim.korap.util.QueryException;
 
-import org.apache.lucene.search.spans.SpanQuery;
-import org.apache.lucene.search.spans.SpanTermQuery;
-import org.apache.lucene.index.Term;
-
 // mvn -Dtest=TestWithinIndex#indexExample1 test
 
 @RunWith(JUnit4.class)
@@ -55,8 +41,8 @@
         fd.addStored("layerInfo", "opennlp/p=pos");
         fd.addString("pubPlace", "Bochum");
         fd.addInt("lastModified", 20130717);
-        fd.addTV("tokens", "abc", "[(0-1)s:a|i:a|_0#0-1|-:t$<i>10]"
-                + "[(1-2)s:b|i:b|_1#1-2]" + "[(2-3)s:c|i:c|_2#2-3]");
+        fd.addTV("tokens", "abc", "[(0-1)s:a|i:a|_0$<i>0<i>1|-:t$<i>10]"
+                + "[(1-2)s:b|i:b|_1$<i>1<i>2]" + "[(2-3)s:c|i:c|_2$<i>2<i>3]");
 
         assertEquals(fd.doc.getField("title").name(), "title");
         assertEquals(fd.doc.getField("title").stringValue(), "Wikipedia");
@@ -100,9 +86,10 @@
         String json = new String("{" + "  \"fields\" : [" + "    { "
                 + "      \"primaryData\" : \"abc\"" + "    }," + "    {"
                 + "      \"name\" : \"tokens\"," + "      \"data\" : ["
-                + "         [ \"s:a\", \"i:a\", \"_0#0-1\", \"-:t$<i>3\"],"
-                + "         [ \"s:b\", \"i:b\", \"_1#1-2\" ],"
-                + "         [ \"s:c\", \"i:c\", \"_2#2-3\" ]" + "      ]"
+                        + "         [ \"s:a\", \"i:a\", \"_0$<i>0<i>1\", \"-:t$<i>3\"],"
+                        + "         [ \"s:b\", \"i:b\", \"_1$<i>1<i>2\" ],"
+                        + "         [ \"s:c\", \"i:c\", \"_2$<i>2<i>3\" ]"
+                        + "      ]"
                 + "    }" + "  ]," + "  \"corpusID\"  : \"WPD\","
                 + "  \"ID\"        : \"WPD-AAA-00001\","
                 + "  \"textClass\" : \"music entertainment\","
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestMatchCollector.java b/src/test/java/de/ids_mannheim/korap/index/TestMatchCollector.java
index fcc7ebf..0c85b64 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestMatchCollector.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestMatchCollector.java
@@ -1,33 +1,19 @@
 package de.ids_mannheim.korap.index;
 
-import java.util.*;
-import java.io.*;
+import static org.junit.Assert.assertEquals;
 
-import org.apache.lucene.util.Version;
-import org.apache.lucene.util.BytesRef;
-import org.apache.lucene.util.Bits;
+import java.io.IOException;
 
-import static org.junit.Assert.*;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.search.spans.SpanQuery;
+import org.apache.lucene.search.spans.SpanTermQuery;
 import org.junit.Test;
-import org.junit.Ignore;
 import org.junit.runner.RunWith;
 import org.junit.runners.JUnit4;
 
-import de.ids_mannheim.korap.KrillIndex;
-import de.ids_mannheim.korap.KrillQuery;
-import de.ids_mannheim.korap.response.Match;
-import de.ids_mannheim.korap.response.MatchCollector;
-import de.ids_mannheim.korap.KrillCollection;
 import de.ids_mannheim.korap.Krill;
-import de.ids_mannheim.korap.query.SpanNextQuery;
-import de.ids_mannheim.korap.query.SpanClassQuery;
-import de.ids_mannheim.korap.index.FieldDocument;
-import de.ids_mannheim.korap.index.MultiTermTokenStream;
-
-import org.apache.lucene.search.spans.SpanQuery;
-import org.apache.lucene.search.spans.SpanOrQuery;
-import org.apache.lucene.search.spans.SpanTermQuery;
-import org.apache.lucene.index.Term;
+import de.ids_mannheim.korap.KrillIndex;
+import de.ids_mannheim.korap.response.MatchCollector;
 
 // mvn -Dtest=TestWithinIndex#indexExample1 test
 
@@ -44,23 +30,23 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-1");
         fd.addString("UID", "1");
-        fd.addTV("base", "abcabcabac", "[(0-1)s:a|i:a|_0#0-1|-:t$<i>10]"
-                + "[(1-2)s:b|i:b|_1#1-2]" + "[(2-3)s:c|i:c|_2#2-3]"
-                + "[(3-4)s:a|i:a|_3#3-4]" + "[(4-5)s:b|i:b|_4#4-5]"
-                + "[(5-6)s:c|i:c|_5#5-6]" + "[(6-7)s:a|i:a|_6#6-7]"
-                + "[(7-8)s:b|i:b|_7#7-8]" + "[(8-9)s:a|i:a|_8#8-9]"
-                + "[(9-10)s:c|i:c|_9#9-10]");
+        fd.addTV("base", "abcabcabac", "[(0-1)s:a|i:a|_0$<i>0<i>1|-:t$<i>10]"
+                + "[(1-2)s:b|i:b|_1$<i>1<i>2]" + "[(2-3)s:c|i:c|_2$<i>2<i>3]"
+                + "[(3-4)s:a|i:a|_3$<i>3<i>4]" + "[(4-5)s:b|i:b|_4$<i>4<i>5]"
+                + "[(5-6)s:c|i:c|_5$<i>5<i>6]" + "[(6-7)s:a|i:a|_6$<i>6<i>7]"
+                + "[(7-8)s:b|i:b|_7$<i>7<i>8]" + "[(8-9)s:a|i:a|_8$<i>8<i>9]"
+                + "[(9-10)s:c|i:c|_9$<i>9<i>10]");
         ki.addDoc(fd);
 
         fd = new FieldDocument();
         fd.addString("ID", "doc-2");
         fd.addString("UID", "2");
-        fd.addTV("base", "bcbabd", "[(0-1)s:b|i:b|_1#0-1]"
-                + "[(1-2)s:c|i:c|s:b|_2#1-2]"
-                + "[(2-3)s:b|i:b|_3#2-3|<>:e#2-4$<i>4]"
-                + "[(3-4)s:a|i:a|_4#3-4|<>:e#3-5$<i>5|<>:e2#3-5$<i>5]"
-                + "[(4-5)s:b|i:b|s:c|_5#4-5]"
-                + "[(5-6)s:d|i:d|_6#5-6|<>:e2#5-6$<i>6]");
+        fd.addTV("base", "bcbabd", "[(0-1)s:b|i:b|_1$<i>0<i>1]"
+                + "[(1-2)s:c|i:c|s:b|_2$<i>1<i>2]"
+                + "[(2-3)s:b|i:b|_3$<i>2<i>3|<>:e#2-4$<i>4]"
+                + "[(3-4)s:a|i:a|_4$<i>3<i>4|<>:e#3-5$<i>5|<>:e2#3-5$<i>5]"
+                + "[(4-5)s:b|i:b|s:c|_5$<i>4<i>5]"
+                + "[(5-6)s:d|i:d|_6$<i>5<i>6|<>:e2#5-6$<i>6]");
         ki.addDoc(fd);
 
         ki.commit();
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestMatchIdentifier.java b/src/test/java/de/ids_mannheim/korap/index/TestMatchIdentifier.java
index 3f651b5..9c7e292 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestMatchIdentifier.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestMatchIdentifier.java
@@ -1,30 +1,28 @@
 package de.ids_mannheim.korap.index;
 
-import java.util.*;
-import java.io.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
-import static org.junit.Assert.*;
+import java.io.IOException;
+import java.util.ArrayList;
+
 import org.junit.Test;
-import org.junit.Ignore;
 import org.junit.runner.RunWith;
 import org.junit.runners.JUnit4;
 
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import de.ids_mannheim.korap.Krill;
+import de.ids_mannheim.korap.KrillIndex;
+import de.ids_mannheim.korap.query.QueryBuilder;
+import de.ids_mannheim.korap.response.Match;
+import de.ids_mannheim.korap.response.Result;
 import de.ids_mannheim.korap.response.match.MatchIdentifier;
 import de.ids_mannheim.korap.response.match.PosIdentifier;
-
-import de.ids_mannheim.korap.KrillIndex;
-import de.ids_mannheim.korap.KrillQuery;
-import de.ids_mannheim.korap.Krill;
-import de.ids_mannheim.korap.query.QueryBuilder;
-import de.ids_mannheim.korap.response.Result;
-import de.ids_mannheim.korap.response.Match;
 import de.ids_mannheim.korap.util.QueryException;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.JsonNode;
-
-import de.ids_mannheim.korap.index.FieldDocument;
-
 @RunWith(JUnit4.class)
 public class TestMatchIdentifier {
 
@@ -580,16 +578,16 @@
         fd.addTV(
                 "tokens",
                 "abcabcabac",
-                "[(0-1)s:a|i:a|f/m:eins|f/y:one|x/o:erstens|it/is:1|>:x/rel:a$<i>4|_0#0-1|-:t$<i>10]"
-                        + "[(1-2)s:b|i:b|f/m:zwei|f/y:two|x/o:zweitens|it/is:2|_1#1-2]"
-                        + "[(2-3)s:c|i:c|f/m:drei|f/y:three|x/o:drittens|it/is:3|_2#2-3|<>:s#2-5$<i>5]"
-                        + "[(3-4)s:a|i:a|f/m:vier|f/y:four|x/o:viertens|it/is:4|<:x/rel:b$<i>1|_3#3-4]"
-                        + "[(4-5)s:b|i:b|f/m:fuenf|f/y:five|x/o:fünftens|it/is:5|_4#4-5]"
-                        + "[(5-6)s:c|i:c|f/m:sechs|f/y:six|x/o:sechstens|it/is:6|_5#5-6]"
-                        + "[(6-7)s:a|i:a|f/m:sieben|f/y:seven|x/o:siebtens|it/is:7|_6#6-7]"
-                        + "[(7-8)s:b|i:b|f/m:acht|f/y:eight|x/o:achtens|it/is:8|<>:x/tag#7-10$<i>10|_7#7-8]"
-                        + "[(8-9)s:a|i:a|f/m:neun|f/y:nine|x/o:neuntens|it/is:9|_8#8-9]"
-                        + "[(9-10)s:c|i:c|f/m:zehn|f/y:ten|x/o:zehntens|it/is:10|_9#9-10]");
+                "[(0-1)s:a|i:a|f/m:eins|f/y:one|x/o:erstens|it/is:1|>:x/rel:a$<i>4|_0$<i>0<i>1|-:t$<i>10]"
+                        + "[(1-2)s:b|i:b|f/m:zwei|f/y:two|x/o:zweitens|it/is:2|_1$<i>1<i>2]"
+                        + "[(2-3)s:c|i:c|f/m:drei|f/y:three|x/o:drittens|it/is:3|_2$<i>2<i>3|<>:s#2-5$<i>5]"
+                        + "[(3-4)s:a|i:a|f/m:vier|f/y:four|x/o:viertens|it/is:4|<:x/rel:b$<i>1|_3$<i>3<i>4]"
+                        + "[(4-5)s:b|i:b|f/m:fuenf|f/y:five|x/o:fünftens|it/is:5|_4$<i>4<i>5]"
+                        + "[(5-6)s:c|i:c|f/m:sechs|f/y:six|x/o:sechstens|it/is:6|_5$<i>5<i>6]"
+                        + "[(6-7)s:a|i:a|f/m:sieben|f/y:seven|x/o:siebtens|it/is:7|_6$<i>6<i>7]"
+                        + "[(7-8)s:b|i:b|f/m:acht|f/y:eight|x/o:achtens|it/is:8|<>:x/tag#7-10$<i>10|_7$<i>7<i>8]"
+                        + "[(8-9)s:a|i:a|f/m:neun|f/y:nine|x/o:neuntens|it/is:9|_8$<i>8<i>9]"
+                        + "[(9-10)s:c|i:c|f/m:zehn|f/y:ten|x/o:zehntens|it/is:10|_9$<i>9<i>10]");
         return fd;
     };
 
@@ -601,16 +599,16 @@
         fd.addTV(
                 "tokens",
                 "abcabcabac",
-                "[(0-1)s:a|i:a|f/m:eins|f/y:one|x/o:erstens|it/is:1|>:x/rel:a$<i>4|_0#0-1|-:t$<i>10]"
-                        + "[(1-2)s:b|i:b|f/m:zwei|f/y:two|x/o:zweitens|it/is:2|>:x/rel:b$<i>4|_1#1-2]"
-                        + "[(2-3)s:c|i:c|f/m:drei|f/y:three|x/o:drittens|it/is:3|_2#2-3|<>:s#2-5$<i>5]"
-                        + "[(3-4)s:a|i:a|f/m:vier|f/y:four|x/o:viertens|it/is:4|<:x/rel:b$<i>1|_3#3-4]"
-                        + "[(4-5)s:b|i:b|f/m:fuenf|f/y:five|x/o:fünftens|it/is:5|_4#4-5]"
-                        + "[(5-6)s:c|i:c|f/m:sechs|f/y:six|x/o:sechstens|it/is:6|_5#5-6]"
-                        + "[(6-7)s:a|i:a|f/m:sieben|f/y:seven|x/o:siebtens|it/is:7|_6#6-7]"
-                        + "[(7-8)s:b|i:b|f/m:acht|f/y:eight|x/o:achtens|it/is:8|<>:x/tag#7-10$<i>10|_7#7-8]"
-                        + "[(8-9)s:a|i:a|f/m:neun|f/y:nine|x/o:neuntens|it/is:9|_8#8-9]"
-                        + "[(9-10)s:c|i:c|f/m:zehn|f/y:ten|x/o:zehntens|it/is:10|_9#9-10]");
+                "[(0-1)s:a|i:a|f/m:eins|f/y:one|x/o:erstens|it/is:1|>:x/rel:a$<i>4|_0$<i>0<i>1|-:t$<i>10]"
+                        + "[(1-2)s:b|i:b|f/m:zwei|f/y:two|x/o:zweitens|it/is:2|>:x/rel:b$<i>4|_1$<i>1<i>2]"
+                        + "[(2-3)s:c|i:c|f/m:drei|f/y:three|x/o:drittens|it/is:3|_2$<i>2<i>3|<>:s#2-5$<i>5]"
+                        + "[(3-4)s:a|i:a|f/m:vier|f/y:four|x/o:viertens|it/is:4|<:x/rel:b$<i>1|_3$<i>3<i>4]"
+                        + "[(4-5)s:b|i:b|f/m:fuenf|f/y:five|x/o:fünftens|it/is:5|_4$<i>4<i>5]"
+                        + "[(5-6)s:c|i:c|f/m:sechs|f/y:six|x/o:sechstens|it/is:6|_5$<i>5<i>6]"
+                        + "[(6-7)s:a|i:a|f/m:sieben|f/y:seven|x/o:siebtens|it/is:7|_6$<i>6<i>7]"
+                        + "[(7-8)s:b|i:b|f/m:acht|f/y:eight|x/o:achtens|it/is:8|<>:x/tag#7-10$<i>10|_7$<i>7<i>8]"
+                        + "[(8-9)s:a|i:a|f/m:neun|f/y:nine|x/o:neuntens|it/is:9|_8$<i>8<i>9]"
+                        + "[(9-10)s:c|i:c|f/m:zehn|f/y:ten|x/o:zehntens|it/is:10|_9$<i>9<i>10]");
         return fd;
     };
 
@@ -622,16 +620,16 @@
         fd.addTV(
                 "tokens",
                 "aa bb cc aa bb cc aa bb aa cc ",
-                "[(0-2)s:aa|i:a|f/m:eins|f/y:one|x/o:erstens|it/is:1|>:x/rel:a$<i>4|_0#0-2|-:t$<i>10]"
-                        + "[(3-5)s:bb|i:b|f/m:zwei|f/y:two|x/o:zweitens|it/is:2|_1#3-5]"
-                        + "[(6-8)s:cc|i:c|f/m:drei|f/y:three|x/o:drittens|it/is:3|_2#6-8|<>:s#6-14$<i>5]"
-                        + "[(9-11)s:aa|i:a|f/m:vier|f/y:four|x/o:viertens|it/is:4|<:x/rel:b$<i>1|_3#9-11]"
-                        + "[(12-14)s:bb|i:b|f/m:fuenf|f/y:five|x/o:fünftens|it/is:5|_4#12-14]"
-                        + "[(15-17)s:cc|i:c|f/m:sechs|f/y:six|x/o:sechstens|it/is:6|_5#15-17]"
-                        + "[(18-20)s:aa|i:a|f/m:sieben|f/y:seven|x/o:siebtens|it/is:7|_6#18-20]"
-                        + "[(21-23)s:bb|i:b|f/m:acht|f/y:eight|x/o:achtens|it/is:8|<>:x/tag#7-10$<i>10|_7#21-23]"
-                        + "[(24-26)s:aa|i:a|f/m:neun|f/y:nine|x/o:neuntens|it/is:9|_8#24-26]"
-                        + "[(27-29)s:cc|i:c|f/m:zehn|f/y:ten|x/o:zehntens|it/is:10|_9#27-29]");
+                "[(0-2)s:aa|i:a|f/m:eins|f/y:one|x/o:erstens|it/is:1|>:x/rel:a$<i>4|_0$<i>0<i>2|-:t$<i>10]"
+                        + "[(3-5)s:bb|i:b|f/m:zwei|f/y:two|x/o:zweitens|it/is:2|_1$<i>3<i>5]"
+                        + "[(6-8)s:cc|i:c|f/m:drei|f/y:three|x/o:drittens|it/is:3|_2$<i>6<i>8|<>:s#6-14$<i>5]"
+                        + "[(9-11)s:aa|i:a|f/m:vier|f/y:four|x/o:viertens|it/is:4|<:x/rel:b$<i>1|_3$<i>9<i>11]"
+                        + "[(12-14)s:bb|i:b|f/m:fuenf|f/y:five|x/o:fünftens|it/is:5|_4$<i>12<i>14]"
+                        + "[(15-17)s:cc|i:c|f/m:sechs|f/y:six|x/o:sechstens|it/is:6|_5$<i>15<i>17]"
+                        + "[(18-20)s:aa|i:a|f/m:sieben|f/y:seven|x/o:siebtens|it/is:7|_6$<i>18<i>20]"
+                        + "[(21-23)s:bb|i:b|f/m:acht|f/y:eight|x/o:achtens|it/is:8|<>:x/tag#7-10$<i>10|_7$<i>21<i>23]"
+                        + "[(24-26)s:aa|i:a|f/m:neun|f/y:nine|x/o:neuntens|it/is:9|_8$<i>24<i>26]"
+                        + "[(27-29)s:cc|i:c|f/m:zehn|f/y:ten|x/o:zehntens|it/is:10|_9$<i>27<i>29]");
         return fd;
     };
 
@@ -643,16 +641,16 @@
         fd.addTV(
                 "tokens",
                 "abcabcabac",
-                "[(0-1)s:a|i:a|f/m:eins|f/y:one|x/o:erstens|it/is:1|>:x/rel:a$<i>4|_0#0-1|-:t$<i>10]"
-                        + "[(1-2)s:b|i:b|f/m:zwei|f/y:two|x/o:zweitens|it/is:2|_1#1-2]"
-                        + "[(2-3)s:c|i:c|f/m:drei|f/y:three|x/o:drittens|it/is:3|_2#2-3|<>:s#2-5$<i>5]"
-                        + "[(3-4)s:a|i:a|f/m:vier|f/y:four|x/o:viertens|it/is:4|<:x/rel:b$<i>1|_3#3-4]"
-                        + "[(4-5)s:b|i:b|f/m:fuenf|f/y:five|x/o:fünftens|it/is:5|_4#4-5]"
-                        + "[(5-6)s:c|i:c|f/m:sechs|f/y:six|x/o:sechstens|it/is:6|_5#5-6|<>:s#5-7$<i>7]"
-                        + "[(6-7)s:a|i:a|f/m:sieben|f/y:seven|x/o:siebtens|it/is:7|_6#6-7]"
-                        + "[(7-8)s:b|i:b|f/m:acht|f/y:eight|x/o:achtens|it/is:8|<>:x/tag#7-10$<i>10|_7#7-8]"
-                        + "[(8-9)s:a|i:a|f/m:neun|f/y:nine|x/o:neuntens|it/is:9|_8#8-9]"
-                        + "[(9-10)s:c|i:c|f/m:zehn|f/y:ten|x/o:zehntens|it/is:10|_9#9-10]");
+                "[(0-1)s:a|i:a|f/m:eins|f/y:one|x/o:erstens|it/is:1|>:x/rel:a$<i>4|_0$<i>0<i>1|-:t$<i>10]"
+                        + "[(1-2)s:b|i:b|f/m:zwei|f/y:two|x/o:zweitens|it/is:2|_1$<i>1<i>2]"
+                        + "[(2-3)s:c|i:c|f/m:drei|f/y:three|x/o:drittens|it/is:3|_2$<i>2<i>3|<>:s#2-5$<i>5]"
+                        + "[(3-4)s:a|i:a|f/m:vier|f/y:four|x/o:viertens|it/is:4|<:x/rel:b$<i>1|_3$<i>3<i>4]"
+                        + "[(4-5)s:b|i:b|f/m:fuenf|f/y:five|x/o:fünftens|it/is:5|_4$<i>4<i>5]"
+                        + "[(5-6)s:c|i:c|f/m:sechs|f/y:six|x/o:sechstens|it/is:6|_5$<i>5<i>6|<>:s#5-7$<i>7]"
+                        + "[(6-7)s:a|i:a|f/m:sieben|f/y:seven|x/o:siebtens|it/is:7|_6$<i>6<i>7]"
+                        + "[(7-8)s:b|i:b|f/m:acht|f/y:eight|x/o:achtens|it/is:8|<>:x/tag#7-10$<i>10|_7$<i>7<i>8]"
+                        + "[(8-9)s:a|i:a|f/m:neun|f/y:nine|x/o:neuntens|it/is:9|_8$<i>8<i>9]"
+                        + "[(9-10)s:c|i:c|f/m:zehn|f/y:ten|x/o:zehntens|it/is:10|_9$<i>9<i>10]");
         return fd;
     };
 
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestMultipleDistanceIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestMultipleDistanceIndex.java
index 6748c44..e291485 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestMultipleDistanceIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestMultipleDistanceIndex.java
@@ -54,12 +54,12 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-0");
         fd.addTV("base", "text",
-                "[(0-1)s:b|_1#0-1|<>:s$<b>64<i>0<i>2<i>2|<>:p$<b>64<i>0<i>4<i>4]"
-                        + "[(1-2)s:b|s:c|_2#1-2]"
-                        + "[(2-3)s:c|_3#2-3|<>:s$<b>64<i>2<i>3<i>4]"
-                        + "[(3-4)s:b|_4#3-4]"
-                        + "[(4-5)s:c|_5#4-5|<>:s$<b>64<i>4<i>6<i>6|<>:p$<b>64<i>4<i>6<i>6]"
-                        + "[(5-6)s:e|_6#5-6]");
+                "[(0-1)s:b|_1$<i>0<i>1|<>:s$<b>64<i>0<i>2<i>2<b>0|<>:p$<b>64<i>0<i>4<i>4<b>0]"
+                        + "[(1-2)s:b|s:c|_2$<i>1<i>2]"
+                        + "[(2-3)s:c|_3$<i>2<i>3|<>:s$<b>64<i>2<i>3<i>4<b>0]"
+                        + "[(3-4)s:b|_4$<i>3<i>4]"
+                        + "[(4-5)s:c|_5$<i>4<i>5|<>:s$<b>64<i>4<i>6<i>6<b>0|<>:p$<b>64<i>4<i>6<i>6<b>0]"
+                        + "[(5-6)s:e|_6$<i>5<i>6]");
         return fd;
     }
 
@@ -68,12 +68,12 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-1");
         fd.addTV("base", "text",
-                "[(0-1)s:c|_1#0-1|<>:s$<b>64<i>0<i>2<i>2|<>:p$<b>64<i>0<i>4<i>4]"
-                        + "[(1-2)s:c|s:e|_2#1-2]"
-                        + "[(2-3)s:e|_3#2-3|<>:s$<b>64<i>2<i>3<i>4]"
-                        + "[(3-4)s:c|_4#3-4]"
-                        + "[(4-5)s:e|_5#4-5|<>:s$<b>64<i>4<i>6<i>6|<>:p$<b>64<i>4<i>6<i>6]"
-                        + "[(5-6)s:c|_6#5-6]");
+                "[(0-1)s:c|_1$<i>0<i>1|<>:s$<b>64<i>0<i>2<i>2<b>0|<>:p$<b>64<i>0<i>4<i>4<b>0]"
+                        + "[(1-2)s:c|s:e|_2$<i>1<i>2]"
+                        + "[(2-3)s:e|_3$<i>2<i>3|<>:s$<b>64<i>2<i>3<i>4<b>0]"
+                        + "[(3-4)s:c|_4$<i>3<i>4]"
+                        + "[(4-5)s:e|_5$<i>4<i>5|<>:s$<b>64<i>4<i>6<i>6<b>0|<>:p$<b>64<i>4<i>6<i>6<b>0]"
+                        + "[(5-6)s:c|_6$<i>5<i>6]");
         return fd;
     }
 
@@ -82,13 +82,13 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-2");
         fd.addTV("base", "text",
-                "[(0-1)s:b|_1#0-1|<>:s$<b>64<i>0<i>2<i>2|<>:p$<b>64<i>0<i>4<i>4]"
-                        + "[(1-2)s:b|s:e|_2#1-2]"
-                        + "[(2-3)s:e|_3#2-3|<>:s$<b>64<i>2<i>3<i>4]"
-                        + "[(3-4)s:b|s:c|_4#3-4]"
-                        + "[(4-5)s:e|_5#4-5|<>:s$<b>64<i>4<i>6<i>6|<>:p$<b>64<i>4<i>6<i>6]"
-                        + "[(5-6)s:d|_6#5-6]"
-                        + "[(6-7)s:b|_7#6-7|<>:s$<b>64<i>6<i>7<i>7|<>:p$<b>64<i>6<i>7<i>7]");
+                "[(0-1)s:b|_1$<i>0<i>1|<>:s$<b>64<i>0<i>2<i>2<b>0|<>:p$<b>64<i>0<i>4<i>4<b>0]"
+                        + "[(1-2)s:b|s:e|_2$<i>1<i>2]"
+                        + "[(2-3)s:e|_3$<i>2<i>3|<>:s$<b>64<i>2<i>3<i>4<b>0]"
+                        + "[(3-4)s:b|s:c|_4$<i>3<i>4]"
+                        + "[(4-5)s:e|_5$<i>4<i>5|<>:s$<b>64<i>4<i>6<i>6<b>0|<>:p$<b>64<i>4<i>6<i>6<b>0]"
+                        + "[(5-6)s:d|_6$<i>5<i>6]"
+                        + "[(6-7)s:b|_7$<i>6<i>7|<>:s$<b>64<i>6<i>7<i>7<b>0|<>:p$<b>64<i>6<i>7<i>7<b>0]");
         return fd;
     }
 
@@ -97,12 +97,12 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-0");
         fd.addTV("base", "text",
-                "[(0-1)s:b|_1#0-1|<>:s$<b>64<i>0<i>2<i>2|<>:p$<b>64<i>0<i>4<i>4]"
-                        + "[(1-2)s:b|s:c|_2#1-2]"
-                        + "[(2-3)s:c|_3#2-3|<>:s$<b>64<i>2<i>3<i>5]"
-                        + "[(3-4)s:b|_4#3-4]" + "[(4-5)s:b|_5#4-5]"
-                        + "[(5-6)s:b|_6#5-6]" + // gap
-                        "[(6-7)s:c|_7#6-7|<>:s$<b>64<i>6<i>7<i>7|<>:p$<b>64<i>6<i>7<i>7]");
+                "[(0-1)s:b|_1$<i>0<i>1|<>:s$<b>64<i>0<i>2<i>2<b>0|<>:p$<b>64<i>0<i>4<i>4<b>0]"
+                        + "[(1-2)s:b|s:c|_2$<i>1<i>2]"
+                        + "[(2-3)s:c|_3$<i>2<i>3|<>:s$<b>64<i>2<i>3<i>5<b>0]"
+                        + "[(3-4)s:b|_4$<i>3<i>4]" + "[(4-5)s:b|_5$<i>4<i>5]"
+                        + "[(5-6)s:b|_6$<i>5<i>6]" + // gap
+                        "[(6-7)s:c|_7$<i>6<i>7|<>:s$<b>64<i>6<i>7<i>7<b>0|<>:p$<b>64<i>6<i>7<i>7<b>0]");
         return fd;
     }
 
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestNextIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestNextIndex.java
index ff985e0..d80acf2 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestNextIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestNextIndex.java
@@ -95,7 +95,7 @@
         FieldDocument fd = new FieldDocument();
         fd.addTV("base", "abcabcabac", "[(0-1)s:a|i:a|_0$<i>0<i>1|-:t$<i>10]"
                 + "[(1-2)s:b|i:b|_1$<i>1<i>2]" + "[(2-3)s:c|i:c|_2$<i>2<i>3]"
-                        + "[(3-4)s:a|i:a|_3$<i>3<i>4|<>:x$<b>64<i>3<i>4<i>4|<>:x$<b>64<i>3<i>7<i>7]"
+                        + "[(3-4)s:a|i:a|_3$<i>3<i>4|<>:x$<b>64<i>3<i>4<i>4<b>0|<>:x$<b>64<i>3<i>7<i>7<b>0]"
                 + "[(4-5)s:b|i:b|_4$<i>4<i>5]" + "[(5-6)s:c|i:c|_5$<i>5<i>6]"
                 + "[(6-7)s:a|i:a|_6$<i>6<i>7]" + "[(7-8)s:b|i:b|_7$<i>7<i>8]"
                 + "[(8-9)s:a|i:a|_8$<i>8<i>9]" + "[(9-10)s:c|i:c|_9$<i>9<i>10]");
@@ -123,7 +123,7 @@
         FieldDocument fd = new FieldDocument();
         fd.addTV("base", "abcabcabac", "[(0-1)s:a|i:a|_0$<i>0<i>1|-:t$<i>10]"
                 + "[(1-2)s:b|i:b|_1$<i>1<i>2]" + "[(2-3)s:c|i:c|_2$<i>2<i>3]"
-                + "[(3-4)s:a|i:a|_3$<i>3<i>4|<>:x$<b>64<i>3<i>7<i>7]"
+                + "[(3-4)s:a|i:a|_3$<i>3<i>4|<>:x$<b>64<i>3<i>7<i>7<b>0]"
                 + "[(4-5)s:b|i:b|_4$<i>4<i>5]" + "[(5-6)s:c|i:c|_5$<i>5<i>6]"
                 + "[(6-7)s:a|i:a|_6$<i>6<i>7]" + "[(7-8)s:b|i:b|_7$<i>7<i>8]"
                 + "[(8-9)s:a|i:a|_8$<i>8<i>9]" + "[(9-10)s:c|i:c|_9$<i>9<i>10]");
@@ -152,9 +152,9 @@
         fd.addString("ID", "doc-1");
         fd.addTV("base", "abcabcabac", "[(0-1)s:a|i:a|_0$<i>0<i>1|-:t$<i>10]"
                 + "[(1-2)s:b|i:b|_1$<i>1<i>2]" + "[(2-3)s:c|i:c|_2$<i>2<i>3]"
-                + "[(3-4)s:a|i:a|_3$<i>3<i>4|<>:x$<b>64<i>3<i>7<i>7]"
+                + "[(3-4)s:a|i:a|_3$<i>3<i>4|<>:x$<b>64<i>3<i>7<i>7<b>0]"
                 + "[(4-5)s:b|i:b|_4$<i>4<i>5]" + "[(5-6)s:c|i:c|_5$<i>5<i>6]"
-                + "[(6-7)s:a|i:a|_6$<i>6<i>7]<>:x$<b>64<i>6<i>8<i>8]"
+                + "[(6-7)s:a|i:a|_6$<i>6<i>7]<>:x$<b>64<i>6<i>8<i>8<b>0]"
                 + "[(7-8)s:b|i:b|_7$<i>7<i>8]" + "[(8-9)s:a|i:a|_8$<i>8<i>9]"
                 + "[(9-10)s:c|i:c|_9$<i>9<i>10]");
         ki.addDoc(fd);
@@ -164,7 +164,7 @@
         fd.addString("ID", "doc-2");
         fd.addTV("base", "xbzxbzxbxz", "[(0-1)s:x|i:x|_0$<i>0<i>1|-:t$<i>10]"
                 + "[(1-2)s:b|i:b|_1$<i>1<i>2]" + "[(2-3)s:z|i:z|_2$<i>2<i>3]"
-                + "[(3-4)s:x|i:x|_3$<i>3<i>4|<>:x$<b>64<i>3<i>7<i>7]"
+                + "[(3-4)s:x|i:x|_3$<i>3<i>4|<>:x$<b>64<i>3<i>7<i>7<b>0]"
                 + "[(4-5)s:b|i:b|_4$<i>4<i>5]" + "[(5-6)s:z|i:z|_5$<i>5<i>6]"
                 + "[(6-7)s:x|i:x|_6$<i>6<i>7]" + "[(7-8)s:b|i:b|_7$<i>7<i>8]"
                 + "[(8-9)s:x|i:x|_8$<i>8<i>9]" + "[(9-10)s:z|i:z|_9$<i>9<i>10]");
@@ -324,7 +324,7 @@
         fd.addString("ID", "doc-0");
         fd.addTV("base", "bcbadb", "[(0-1)s:b|i:b|_0$<i>0<i>1]"
                 + "[(1-2)s:c|i:c|s:b|_1$<i>1<i>2]" + "[(2-3)s:b|i:b|_2$<i>2<i>3]"
-                + "[(3-4)s:a|i:a|_3$<i>3<i>4|<>:e$<b>64<i>3<i>6<i>6]"
+                + "[(3-4)s:a|i:a|_3$<i>3<i>4|<>:e$<b>64<i>3<i>6<i>6<b>0]"
                 + "[(4-5)s:d|i:d|s:c|_4$<i>4<i>5]" + "[(5-6)s:b|i:b|_5$<i>5<i>6]");
         return fd;
     }
@@ -334,7 +334,7 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-1");
         fd.addTV("base", "caba", "[(0-1)s:c|i:c|_0$<i>0<i>1]"
-                + "[(1-2)s:a|i:a|s:c|_1$<i>1<i>2|<>:e$<b>64<i>1<i>3<i>3]"
+                + "[(1-2)s:a|i:a|s:c|_1$<i>1<i>2|<>:e$<b>64<i>1<i>3<i>3<b>0]"
                 + "[(2-3)s:b|i:b|s:a|_2$<i>2<i>3]" + "[(3-4)s:a|i:a|_3$<i>3<i>4]");
         return fd;
     }
@@ -355,9 +355,9 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-3");
         fd.addTV("base", "bcbadb", "[(0-1)s:b|i:b|_0$<i>0<i>1]"
-                + "[(1-2)s:c|i:c|s:b|<>:s$<b>64<i>1<i>3<i>3|_1$<i>1<i>2]"
+                + "[(1-2)s:c|i:c|s:b|<>:s$<b>64<i>1<i>3<i>3<b>0|_1$<i>1<i>2<b>0]"
                 + "[(2-3)s:b|i:b|_2$<i>2<i>3]"
-                + "[(3-4)s:a|i:a|_3$<i>3<i>4|<>:e$<b>64<i>3<i>6<i>6]"
+                + "[(3-4)s:a|i:a|_3$<i>3<i>4|<>:e$<b>64<i>3<i>6<i>6<b>0]"
                 + "[(4-5)s:d|i:d|s:c|_4$<i>4<i>5]" + "[(5-6)s:b|i:b|_5$<i>5<i>6]");
         return fd;
     }
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestPosToOffset.java b/src/test/java/de/ids_mannheim/korap/index/TestPosToOffset.java
index 1b0803a..a01186f 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestPosToOffset.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestPosToOffset.java
@@ -1,32 +1,15 @@
 package de.ids_mannheim.korap.index;
 
-import java.util.*;
-import java.io.*;
+import static org.junit.Assert.assertEquals;
 
-import static org.junit.Assert.*;
+import java.io.IOException;
+
+import org.apache.lucene.index.LeafReaderContext;
 import org.junit.Test;
-import org.junit.Ignore;
 import org.junit.runner.RunWith;
 import org.junit.runners.JUnit4;
 
 import de.ids_mannheim.korap.KrillIndex;
-import de.ids_mannheim.korap.KrillQuery;
-import de.ids_mannheim.korap.response.Result;
-import de.ids_mannheim.korap.query.SpanElementQuery;
-import de.ids_mannheim.korap.query.SpanWithinQuery;
-import de.ids_mannheim.korap.query.SpanNextQuery;
-import de.ids_mannheim.korap.query.SpanClassQuery;
-import de.ids_mannheim.korap.index.FieldDocument;
-import de.ids_mannheim.korap.index.MultiTermTokenStream;
-import de.ids_mannheim.korap.index.PositionsToOffset;
-
-import org.apache.lucene.index.LeafReaderContext;
-import org.apache.lucene.search.spans.SpanQuery;
-import org.apache.lucene.search.spans.SpanTermQuery;
-import org.apache.lucene.index.TermContext;
-import org.apache.lucene.util.Bits;
-
-import java.nio.ByteBuffer;
 
 
 @RunWith(JUnit4.class)
@@ -37,13 +20,13 @@
         KrillIndex ki = new KrillIndex();
 
         FieldDocument fd = new FieldDocument();
-        fd.addTV("base", "a b c", "[(0-1)s:a|i:a|_0#0-1|-:t$<i>3]"
-                + "[(2-3)s:b|i:b|_1#2-3]" + "[(4-5)s:c|i:c|_2#4-5]");
+        fd.addTV("base", "a b c", "[(0-1)s:a|i:a|_0$<i>0<i>1|-:t$<i>3]"
+                + "[(2-3)s:b|i:b|_1$<i>2<i>3]" + "[(4-5)s:c|i:c|_2$<i>4<i>5]");
         ki.addDoc(fd);
 
         fd = new FieldDocument();
-        fd.addTV("base", "x  y  z", "[(0-1)s:x|i:x|_0#0-2|-:t$<i>3]"
-                + "[(3-4)s:y|i:y|_1#3-4]" + "[(6-7)s:z|i:z|_2#6-7]");  // 3
+        fd.addTV("base", "x  y  z", "[(0-1)s:x|i:x|_0$<i>0<i>2|-:t$<i>3]"
+                + "[(3-4)s:y|i:y|_1$<i>3<i>4]" + "[(6-7)s:z|i:z|_2$<i>6<i>7]"); // 3
         ki.addDoc(fd);
         ki.commit();
 
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestReferenceIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestReferenceIndex.java
index ba397b3..995f32d 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestReferenceIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestReferenceIndex.java
@@ -242,11 +242,13 @@
                 "tokens",
                 "Frankenstein, treat my daughter well. She is the one that saved your master who you hold so dear.",
 
-                "[(0-12)s:Frankenstein|_0$<i>0<i>12|<>:nn$<b>64<i>0<i>12<i>1<s>18|<>:s$<b>64<i>0<i>37<i>4<s>1|"
-                        + "<>:np$<b>64<i>0<i>13<i>1<s>2|"
+                "[(0-12)s:Frankenstein|_0$<i>0<i>12|<>:nn$<b>64<i>0<i>12<i>1<b>0<s>18|"
+                        + "<>:s$<b>64<i>0<i>37<i>4<b>0<s>1|"
+                        + "<>:np$<b>64<i>0<i>13<i>1<b>0<s>2|"
                         + "<:stanford/d:tag$<i>1<s>1<s>18<s>19]"
 
-                        + "[(14-19)s:treat|_1$<i>14<i>19|<>:vb$<b>64<i>14<i>19<i>2<s>19|<>:vp$<b>64<i>14<i>36<i>4<s>3|"
+                        + "[(14-19)s:treat|_1$<i>14<i>19|<>:vb$<b>64<i>14<i>19<i>2<b>0<s>19|"
+                        + "<>:vp$<b>64<i>14<i>36<i>4<b>0<s>3|"
                         + ">:stanford/d:tag$<i>0<s>2<s>19<s>18|"
                         + ">:stanford/d:tag$<i>3<s>3<s>19<s>21|"
                         + ">:stanford/d:tag$<i>4<s>4<s>19<s>22]"
@@ -268,59 +270,73 @@
                 "tokens",
                 "Frankenstein, treat my daughter well. She is the one that saved your master who you hold so dear.",
 
-                "[(0-12)s:Frankenstein|_0$<i>0<i>12|<>:nn$<b>64<i>0<i>12<i>1<s>18|<>:s$<b>64<i>0<i>37<i>5<s>1|"
-                        + "<>:np$<b>64<i>0<i>13<i>1<s>2|"
+                "[(0-12)s:Frankenstein|_0$<i>0<i>12|<>:nn$<b>64<i>0<i>12<i>1<b>0<s>18|"
+                        + "<>:s$<b>64<i>0<i>37<i>5<b>0<s>1|"
+                        + "<>:np$<b>64<i>0<i>13<i>1<b>0<s>2|"
                         + "<:stanford/d:tag$<i>1<s>1<s>18<s>19]"
 
-                        + "[(14-19)s:treat|_1$<i>14<i>19|<>:vb$<b>64<i>14<i>19<i>2<s>19|<>:vp$<b>64<i>14<i>36<i>5<s>3|"
+                        + "[(14-19)s:treat|_1$<i>14<i>19|<>:vb$<b>64<i>14<i>19<i>2<b>0<s>19|"
+                        + "<>:vp$<b>64<i>14<i>36<i>5<b>0<s>3|"
                         + ">:stanford/d:tag$<i>0<s>2<s>19<s>18|"
                         + ">:stanford/d:tag$<i>3<s>3<s>19<s>21|"
                         + ">:stanford/d:tag$<i>4<s>4<s>19<s>22]"
 
-                        + "[(20-22)s:my|_2$<i>20<i>22|<>:prp$<b>64<i>20<i>22<i>3<s>20|<>:np$<b>64<i>20<i>31<i>4<s>4]"
+                        + "[(20-22)s:my|_2$<i>20<i>22|<>:prp$<b>64<i>20<i>22<i>3<b>0<s>20|<>:np$<b>64<i>20<i>31<i>4<b>0<s>4]"
 
-                        + "[(23-31)s:daughter|_3$<i>23<i>31|<>:nn$<b>64<i>23<i>31<i>4<s>21|"
+                        + "[(23-31)s:daughter|_3$<i>23<i>31|<>:nn$<b>64<i>23<i>31<i>4<b>0<s>21|"
                         + ">:stanford/d:tag$<i>2<s>5<s>21<s>20]"
 
-                        + "[(32-36)s:well|_4$<i>32<i>36|<>:rb$<b>64<i>32<i>36<i>5<s>22|<>:advp$<b>64<i>32<i>36<i>5<s>5]"
+                        + "[(32-36)s:well|_4$<i>32<i>36|<>:rb$<b>64<i>32<i>36<i>5<b>0<s>22|<>:advp$<b>64<i>32<i>36<i>5<b>0<s>5]"
 
-                        + "[(38-41)s:She|_5$<i>38<i>41|<>:prp$<b>64<i>38<i>41<i>6<s>23|<>:np$<b>64<i>38<i>41<i>6<s>36|<>:s$<b>64<i>38<i>97<i>18<s>6]"
+                        + "[(38-41)s:She|_5$<i>38<i>41|<>:prp$<b>64<i>38<i>41<i>6<b>0<s>23|"
+                        + "<>:np$<b>64<i>38<i>41<i>6<b>0<s>36|"
+                        + "<>:s$<b>64<i>38<i>97<i>18<b>0<s>6]"
 
-                        + "[(42-44)s:is|_6$<i>42<i>44|<>:vb$<b>64<i>42<i>44<i>7<s>24|<>:vp$<b>64<i>42<i>96<i>18<s>7]"
+                        + "[(42-44)s:is|_6$<i>42<i>44|<>:vb$<b>64<i>42<i>44<i>7<b>0<s>24|<>:vp$<b>64<i>42<i>96<i>18<b>0<s>7]"
 
-                        + "[(45-48)s:the|_7$<i>45<i>48|<>:dt$<b>64<i>45<i>48<i>8<s>25|<>:np$<b>64<i>45<i>52<i>9<s>8|<>:np$<b>64<i>45<i>96<i>18<s>9]"
+                        + "[(45-48)s:the|_7$<i>45<i>48|<>:dt$<b>64<i>45<i>48<i>8<b>0<s>25|"
+                        + "<>:np$<b>64<i>45<i>52<i>9<b>0<s>8|"
+                        + "<>:np$<b>64<i>45<i>96<i>18<b>0<s>9]"
 
-                        + "[(49-52)s:one|_8$<i>49<i>52|<>:nn$<b>64<i>49<i>52<i>9<s>26|"
+                        + "[(49-52)s:one|_8$<i>49<i>52|<>:nn$<b>64<i>49<i>52<i>9<b>0<s>26|"
                         + ">:stanford/d:tag$<i>5<s>6<s>26<s>23|"
                         + ">:stanford/d:tag$<i>6<s>7<s>26<s>24|"
                         + ">:stanford/d:tag$<i>7<s>8<s>26<s>25|"
                         + ">:stanford/d:tag$<i>10<s>9<s>26<s>28]"
 
-                        + "[(53-57)s:that|_9$<i>53<i>57|<>:rp$<b>64<i>53<i>57<i>10<s>27|<>:sb$<b>64<i>53<i>96<i>18<s>10]"
+                        + "[(53-57)s:that|_9$<i>53<i>57|<>:rp$<b>64<i>53<i>57<i>10<b>0<s>27|"
+                        + "<>:sb$<b>64<i>53<i>96<i>18<b>0<s>10]"
 
-                        + "[(58-63)s:saved|_10$<i>58<i>63|<>:vb$<b>64<i>58<i>63<i>11<s>28|<>:s$<b>64<i>58<i>96<i>18<s>11|"
-                        + "<>:vp$<b>64<i>58<i>96<i>18<s>12|"
+                        + "[(58-63)s:saved|_10$<i>58<i>63|<>:vb$<b>64<i>58<i>63<i>11<b>0<s>28|"
+                        + "<>:s$<b>64<i>58<i>96<i>18<b>0<s>11|"
+                        + "<>:vp$<b>64<i>58<i>96<i>18<b>0<s>12|"
                         + ">:stanford/d:tag$<i>9<s>10<s>28<s>27|"
                         + ">:stanford/d:tag$<i>12<s>11<s>28<s>30|"
                         + ">:stanford/d:tag$<i>15<s>12<s>28<s>33]"
 
-                        + "[(64-68)s:your|_11$<i>64<i>68|<>:prp$<b>64<i>64<i>68<i>12<s>29|<>:np$<b>64<i>64<i>75<i>13<s>13]"
+                        + "[(64-68)s:your|_11$<i>64<i>68|<>:prp$<b>64<i>64<i>68<i>12<b>0<s>29|"
+                        + "<>:np$<b>64<i>64<i>75<i>13<b>0<s>13]"
 
-                        + "[(69-75)s:master|_12$<i>69<i>75|<>:nn$<b>64<i>69<i>75<i>13<s>30|"
+                        + "[(69-75)s:master|_12$<i>69<i>75|<>:nn$<b>64<i>69<i>75<i>13<b>0<s>30|"
                         + ">:stanford/d:tag$<i>11<s>13<s>30<s>29]"
 
-                        + "[(76-79)s:who|_13$<i>76<i>79|<>:rp$<b>64<i>76<i>79<i>14<s>31|<>:sb$<b>64<i>76<i>96<i>18<s>14]"
+                        + "[(76-79)s:who|_13$<i>76<i>79|<>:rp$<b>64<i>76<i>79<i>14<b>0<s>31|"
+                        + "<>:sb$<b>64<i>76<i>96<i>18<b>0<s>14]"
 
-                        + "[(80-83)s:you|_14$<i>80<i>83|<>:prp$<b>64<i>80<i>83<i>15<s>32|<>:np$<b>64<i>80<i>83<i>15<s>37|<>:s$<b>64<i>80<i>96<i>18<s>15]"
+                        + "[(80-83)s:you|_14$<i>80<i>83|<>:prp$<b>64<i>80<i>83<i>15<b>0<s>32|"
+                        + "<>:np$<b>64<i>80<i>83<i>15<b>0<s>37|"
+                        + "<>:s$<b>64<i>80<i>96<i>18<b>0<s>15]"
 
-                        + "[(84-88)s:hold|_15$<i>84<i>88|<>:vb$<b>64<i>84<i>88<i>16<s>33|<>:vp$<b>64<i>84<i>96<i>18<s>16|"
+                        + "[(84-88)s:hold|_15$<i>84<i>88|<>:vb$<b>64<i>84<i>88<i>16<b>0<s>33|"
+                        + "<>:vp$<b>64<i>84<i>96<i>18<b>0<s>16|"
                         + ">:stanford/d:tag$<i>13<s>14<s>33<s>31|"
                         + ">:stanford/d:tag$<i>14<s>15<s>33<s>32|"
                         + ">:stanford/d:tag$<i>17<s>16<s>33<s>35]"
 
-                        + "[(89-91)s:so|_16$<i>89<i>91|<>:rb$<b>64<i>89<i>91<i>17<s>341|<>:adjp$<b>64<i>89<i>96<i>18<s>17]"
+                        + "[(89-91)s:so|_16$<i>89<i>91|<>:rb$<b>64<i>89<i>91<i>17<b>0<s>341|"
+                        + "<>:adjp$<b>64<i>89<i>96<i>18<b>0<s>17]"
 
-                        + "[(92-96)s:dear|_17$<i>92<i>96|<>:jj$<b>64<i>92<i>96<i>18<s>35|"
+                        + "[(92-96)s:dear|_17$<i>92<i>96|<>:jj$<b>64<i>92<i>96<i>18<b>0<s>35|"
                         + ">:stanford/d:tag$<i>16<s>17<s>35<s>34]");
 
         return fd;
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestRegexWildcardIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestRegexWildcardIndex.java
index fdb1c81..bff6608 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestRegexWildcardIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestRegexWildcardIndex.java
@@ -1,28 +1,16 @@
 package de.ids_mannheim.korap.index;
 
-import java.util.*;
-import java.io.*;
+import static org.junit.Assert.assertEquals;
 
-import org.apache.lucene.util.Version;
-import org.apache.lucene.util.BytesRef;
-import org.apache.lucene.util.Bits;
-
-import static org.junit.Assert.*;
+import org.apache.lucene.search.spans.SpanQuery;
 import org.junit.Test;
-import org.junit.Ignore;
 import org.junit.runner.RunWith;
 import org.junit.runners.JUnit4;
 
-import de.ids_mannheim.korap.KrillIndex;
-import de.ids_mannheim.korap.KrillQuery;
-import de.ids_mannheim.korap.response.Result;
 import de.ids_mannheim.korap.Krill;
+import de.ids_mannheim.korap.KrillIndex;
 import de.ids_mannheim.korap.query.QueryBuilder;
-import de.ids_mannheim.korap.index.FieldDocument;
-import de.ids_mannheim.korap.index.MultiTermTokenStream;
-import org.apache.lucene.search.Query;
-import org.apache.lucene.search.spans.SpanQuery;
-import org.apache.lucene.search.spans.SpanTermQuery;
+import de.ids_mannheim.korap.response.Result;
 
 @RunWith(JUnit4.class)
 public class TestRegexWildcardIndex {
@@ -36,15 +24,16 @@
         fd.addTV(
                 "base",
                 "affe afffe baum baumgarten steingarten franz hans haus efeu effe",
-                "[(0-4)s:affe|_0#0-4|-:t$<i>10]" + "[(5-10)s:afffe|_1#5-10]"
-                        + "[(11-15)s:baum|_2#11-15]"
-                        + "[(16-26)s:baumgarten|_3#16-26]"
-                        + "[(27-38)s:steingarten|_4#27-38]"
-                        + "[(39-44)s:franz|_5#39-44]"
-                        + "[(45-49)s:hans|_6#45-49]"
-                        + "[(50-54)s:haus|_7#50-54]"
-                        + "[(55-59)s:efeu|_8#55-59]"
-                        + "[(60-64)s:effe|_9#60-64]");
+                "[(0-4)s:affe|_0$<i>0<i>4|-:t$<i>10]"
+                        + "[(5-10)s:afffe|_1$<i>5<i>10]"
+                        + "[(11-15)s:baum|_2$<i>11<i>15]"
+                        + "[(16-26)s:baumgarten|_3$<i>16<i>26]"
+                        + "[(27-38)s:steingarten|_4$<i>27<i>38]"
+                        + "[(39-44)s:franz|_5$<i>39<i>44]"
+                        + "[(45-49)s:hans|_6$<i>45<i>49]"
+                        + "[(50-54)s:haus|_7$<i>50<i>54]"
+                        + "[(55-59)s:efeu|_8$<i>55<i>59]"
+                        + "[(60-64)s:effe|_9$<i>60<i>64]");
         ki.addDoc(fd);
 
         ki.commit();
@@ -106,15 +95,16 @@
         fd.addTV(
                 "base",
                 "affe afffe baum baumgarten steingarten franz hans haus efeu effe",
-                "[(0-4)s:affe|_0#0-4|-:t$<i>10]" + "[(5-10)s:afffe|_1#5-10]"
-                        + "[(11-15)s:baum|_2#11-15]"
-                        + "[(16-26)s:baumgarten|_3#16-26]"
-                        + "[(27-38)s:steingarten|_4#27-38]"
-                        + "[(39-44)s:franz|_5#39-44]"
-                        + "[(45-49)s:hans|_6#45-49]"
-                        + "[(50-54)s:haus|_7#50-54]"
-                        + "[(55-59)s:efeu|_8#55-59]"
-                        + "[(60-64)s:effe|_9#60-64]");
+                "[(0-4)s:affe|_0$<i>0<i>4|-:t$<i>10]"
+                        + "[(5-10)s:afffe|_1$<i>5<i>10]"
+                        + "[(11-15)s:baum|_2$<i>11<i>15]"
+                        + "[(16-26)s:baumgarten|_3$<i>16<i>26]"
+                        + "[(27-38)s:steingarten|_4$<i>27<i>38]"
+                        + "[(39-44)s:franz|_5$<i>39<i>44]"
+                        + "[(45-49)s:hans|_6$<i>45<i>49]"
+                        + "[(50-54)s:haus|_7$<i>50<i>54]"
+                        + "[(55-59)s:efeu|_8$<i>55<i>59]"
+                        + "[(60-64)s:effe|_9$<i>60<i>64]");
         ki.addDoc(fd);
 
         ki.commit();
@@ -178,16 +168,16 @@
         fd.addTV(
                 "base",
                 "AfFe aFfFE Baum Baumgarten SteinGarten franZ HaNs Haus Efeu effe",
-                "[(0-4)s:AfFe|i:affe|_0#0-4|-:t$<i>10]"
-                        + "[(5-10)s:aFfFE|i:afffe|_1#5-10]"
-                        + "[(11-15)s:Baum|i:baum|_2#11-15]"
-                        + "[(16-26)s:Baumgarten|i:baumgarten|_3#16-26]"
-                        + "[(27-38)s:SteinGarten|i:steingarten|_4#27-38]"
-                        + "[(39-44)s:franZ|i:franz|_5#39-44]"
-                        + "[(45-49)s:HaNs|i:hans|_6#45-49]"
-                        + "[(50-54)s:Haus|i:haus|_7#50-54]"
-                        + "[(55-59)s:Efeu|i:efeu|_8#55-59]"
-                        + "[(60-64)s:effe|i:effe|_9#60-64]");
+                "[(0-4)s:AfFe|i:affe|_0$<i>0<i>4|-:t$<i>10]"
+                        + "[(5-10)s:aFfFE|i:afffe|_1$<i>5<i>10]"
+                        + "[(11-15)s:Baum|i:baum|_2$<i>11<i>15]"
+                        + "[(16-26)s:Baumgarten|i:baumgarten|_3$<i>16<i>26]"
+                        + "[(27-38)s:SteinGarten|i:steingarten|_4$<i>27<i>38]"
+                        + "[(39-44)s:franZ|i:franz|_5$<i>39<i>44]"
+                        + "[(45-49)s:HaNs|i:hans|_6$<i>45<i>49]"
+                        + "[(50-54)s:Haus|i:haus|_7$<i>50<i>54]"
+                        + "[(55-59)s:Efeu|i:efeu|_8$<i>55<i>59]"
+                        + "[(60-64)s:effe|i:effe|_9$<i>60<i>64]");
         ki.addDoc(fd);
 
         ki.commit();
@@ -260,15 +250,16 @@
         fd.addTV(
                 "base",
                 "affe afffe baum baumgarten steingarten franz hans haus efeu effe",
-                "[(0-4)s:affe|_0#0-4|-:t$<i>10]" + "[(5-10)s:afffe|_1#5-10]"
-                        + "[(11-15)s:baum|_2#11-15]"
-                        + "[(16-26)s:baumgarten|_3#16-26]"
-                        + "[(27-38)s:steingarten|_4#27-38]"
-                        + "[(39-44)s:franz|_5#39-44]"
-                        + "[(45-49)s:hans|_6#45-49]"
-                        + "[(50-54)s:haus|_7#50-54]"
-                        + "[(55-59)s:efeu|_8#55-59]"
-                        + "[(60-64)s:effe|_9#60-64]");
+                "[(0-4)s:affe|_0$<i>0<i>4|-:t$<i>10]"
+                        + "[(5-10)s:afffe|_1$<i>5<i>10]"
+                        + "[(11-15)s:baum|_2$<i>11<i>15]"
+                        + "[(16-26)s:baumgarten|_3$<i>16<i>26]"
+                        + "[(27-38)s:steingarten|_4$<i>27<i>38]"
+                        + "[(39-44)s:franz|_5$<i>39<i>44]"
+                        + "[(45-49)s:hans|_6$<i>45<i>49]"
+                        + "[(50-54)s:haus|_7$<i>50<i>54]"
+                        + "[(55-59)s:efeu|_8$<i>55<i>59]"
+                        + "[(60-64)s:effe|_9$<i>60<i>64]");
         ki.addDoc(fd);
 
         ki.commit();
@@ -300,15 +291,16 @@
         fd.addTV(
                 "base",
                 "affe afffe baum baumgarten steingarten franz hans haus efeu effe",
-                "[(0-4)s:affe|_0#0-4|-:t$<i>10]" + "[(5-10)s:afffe|_1#5-10]"
-                        + "[(11-15)s:baum|_2#11-15]"
-                        + "[(16-26)s:baumgarten|_3#16-26]"
-                        + "[(27-38)s:steingarten|_4#27-38]"
-                        + "[(39-44)s:franz|_5#39-44]"
-                        + "[(45-49)s:hans|_6#45-49]"
-                        + "[(50-54)s:haus|_7#50-54]"
-                        + "[(55-59)s:efeu|_8#55-59]"
-                        + "[(60-64)s:effe|_9#60-64]");
+                "[(0-4)s:affe|_0$<i>0<i>4|-:t$<i>10]"
+                        + "[(5-10)s:afffe|_1$<i>5<i>10]"
+                        + "[(11-15)s:baum|_2$<i>11<i>15]"
+                        + "[(16-26)s:baumgarten|_3$<i>16<i>26]"
+                        + "[(27-38)s:steingarten|_4$<i>27<i>38]"
+                        + "[(39-44)s:franz|_5$<i>39<i>44]"
+                        + "[(45-49)s:hans|_6$<i>45<i>49]"
+                        + "[(50-54)s:haus|_7$<i>50<i>54]"
+                        + "[(55-59)s:efeu|_8$<i>55<i>59]"
+                        + "[(60-64)s:effe|_9$<i>60<i>64]");
         ki.addDoc(fd);
 
         ki.commit();
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestRepetitionIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestRepetitionIndex.java
index 63093fc..8ce4a9e 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestRepetitionIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestRepetitionIndex.java
@@ -1,6 +1,6 @@
 package de.ids_mannheim.korap.index;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
 
 import java.io.IOException;
 
@@ -11,10 +11,9 @@
 import org.junit.Test;
 
 import de.ids_mannheim.korap.KrillIndex;
-import de.ids_mannheim.korap.response.Match;
-import de.ids_mannheim.korap.response.Result;
 import de.ids_mannheim.korap.query.SpanNextQuery;
 import de.ids_mannheim.korap.query.SpanRepetitionQuery;
+import de.ids_mannheim.korap.response.Result;
 
 public class TestRepetitionIndex {
 
@@ -25,14 +24,16 @@
     private FieldDocument createFieldDoc0 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-0");
-        fd.addTV("base", "text", "[(0-1)s:c|_1#0-1]" + "[(1-2)s:e|_2#1-2]"
-                + "[(2-3)s:c|_3#2-3|<>:y#2-4$<i>4]"
-                + "[(3-4)s:c|s:b|_4#3-4|<>:x#3-7$<i>7]"
-                + "[(4-5)s:e|s:d|_5#4-5|<>:y#4-6$<i>6]"
-                + "[(5-6)s:c|_6#5-6|<>:y#5-8$<i>8]" + "[(6-7)s:d|_7#6-7]"
-                + "[(7-8)s:e|_8#7-8|<>:x#7-9$<i>9]"
-                + "[(8-9)s:e|s:b|_9#8-9|<>:x#8-10$<i>10]"
-                + "[(9-10)s:d|_10#9-10]");
+        fd.addTV("base", "text", "[(0-1)s:c|_1$<i>0<i>1]"
+                + "[(1-2)s:e|_2$<i>1<i>2]"
+                + "[(2-3)s:c|_3$<i>2<i>3|<>:y$<b>64<i>2<i>4<i>4<b>0]"
+                + "[(3-4)s:c|s:b|_4$<i>3<i>4|<>:x$<b>64<i>3<i>7<i>7<b>0]"
+                + "[(4-5)s:e|s:d|_5$<i>4<i>5|<>:y$<b>64<i>4<i>6<i>6<b>0]"
+                + "[(5-6)s:c|_6$<i>5<i>6|<>:y$<b>64<i>5<i>8<i>8]"
+                + "[(6-7)s:d|_7$<i>6<i>7<b>0]"
+                + "[(7-8)s:e|_8$<i>7<i>8|<>:x$<b>64<i>7<i>9<i>9<b>0]"
+                + "[(8-9)s:e|s:b|_9$<i>8<i>9|<>:x$<b>64<i>8<i>10<i>10<b>0]"
+                + "[(9-10)s:d|_10$<i>9<i>10]");
         return fd;
     }
 
@@ -40,11 +41,12 @@
     private FieldDocument createFieldDoc1 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-1");
-        fd.addTV("base", "text", "[(0-1)s:b|_1#0-1]" + "[(1-2)s:e|_2#1-2]"
-                + "[(2-3)s:c|_3#2-3]" + "[(3-4)s:c|s:d]"
-                + "[(4-5)s:d|s:c|_5#4-5]" + "[(5-6)s:e|s:c|_6#5-6]"
-                + "[(6-7)s:e|_7#6-7]" + "[(7-8)s:c|_8#7-8]"
-                + "[(8-9)s:d|_9#8-9]" + "[(9-10)s:d|_10#9-10]");
+        fd.addTV("base", "text", "[(0-1)s:b|_1$<i>0<i>1]"
+                + "[(1-2)s:e|_2$<i>1<i>2]" + "[(2-3)s:c|_3$<i>2<i>3]"
+                + "[(3-4)s:c|s:d]" + "[(4-5)s:d|s:c|_5$<i>4<i>5]"
+                + "[(5-6)s:e|s:c|_6$<i>5<i>6]" + "[(6-7)s:e|_7$<i>6<i>7]"
+                + "[(7-8)s:c|_8$<i>7<i>8]" + "[(8-9)s:d|_9$<i>8<i>9]"
+                + "[(9-10)s:d|_10$<i>9<i>10]");
         return fd;
     }
 
@@ -52,11 +54,14 @@
     private FieldDocument createFieldDoc2 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-2");
-        fd.addTV("base", "text", "[(0-1)s:b|s:c|_1#0-1|<>:s#0-2$<i>1]"
-                + "[(1-2)s:c|_2#1-2]" + "[(2-3)s:b|_3#2-3|<>:s#2-3$<i>3]"
-                + "[(3-4)s:c|_4#3-4|<>:s#3-4$<i>4]"
-                + "[(4-5)s:c|_5#4-5|<>:s#4-5$<i>5]" + "[(5-6)s:b|_6#5-6]"
-                + "[(6-7)s:c|_7#6-7|<>:s#6-7$<i>7]");
+        fd.addTV("base", "text",
+                "[(0-1)s:b|s:c|_1$<i>0<i>1|<>:s$<b>64<i>0<i>2<i>1<b>0]"
+                        + "[(1-2)s:c|_2$<i>1<i>2]"
+                        + "[(2-3)s:b|_3$<i>2<i>3|<>:s$<b>64<i>2<i>3<i>3<b>0]"
+                        + "[(3-4)s:c|_4$<i>3<i>4|<>:s$<b>64<i>3<i>4<i>4<b>0]"
+                        + "[(4-5)s:c|_5$<i>4<i>5|<>:s$<b>64<i>4<i>5<i>5]"
+                        + "[(5-6)s:b|_6$<i>5<i>6<b>0]"
+                        + "[(6-7)s:c|_7$<i>6<i>7|<>:s$<b>64<i>6<i>7<i>7<b>0]");
         return fd;
     }
 
@@ -64,8 +69,10 @@
     private FieldDocument createFieldDoc3 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-3");
-        fd.addTV("base", "text", "[(0-1)s:a|_1#0-1|<>:s#0-2$<i>1]"
-                + "[(1-2)s:d|_2#1-2|<>:s#1-2$<i>3]" + "[(2-3)s:e|_3#2-3]");
+        fd.addTV("base", "text",
+                "[(0-1)s:a|_1$<i>0<i>1|<>:s$<b>64<i>0<i>2<i>1<b>0]"
+                        + "[(1-2)s:d|_2$<i>1<i>2|<>:s$<b>64<i>1<i>2<i>3]"
+                        + "[(2-3)s:e|_3$<i>2<i>3<b>0]");
         return fd;
     }
 
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestSegmentIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestSegmentIndex.java
index 78d115c..b0c1305 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestSegmentIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestSegmentIndex.java
@@ -181,10 +181,11 @@
         fd.addString("ID", "doc-0");
         fd.addTV("base", "bcbabd", "[(0-1)s:b|i:b|_1$<i>0<i>1]"
                 + "[(1-2)s:c|i:c|s:b|_2$<i>1<i>2]"
-                        + "[(2-3)s:b|i:b|_3$<i>2<i>3|<>:e$<b>64<i>2<i>4<i>4]"
-                        + "[(3-4)s:a|i:a|_4$<i>3<i>4|<>:e$<b>64<i>3<i>5<i>5|<>:e2$<b>64<i>3<i>5<i>5]"
+                + "[(2-3)s:b|i:b|_3$<i>2<i>3|<>:e$<b>64<i>2<i>4<i>4<b>0]"
+                + "[(3-4)s:a|i:a|_4$<i>3<i>4|<>:e$<b>64<i>3<i>5<i>5<b>0|"
+                + "<>:e2$<b>64<i>3<i>5<i>5<b>0]"
                 + "[(4-5)s:b|i:b|s:c|_5$<i>4<i>5]"
-                        + "[(5-6)s:d|i:d|_6$<i>5<i>6|<>:e2$<b>64<i>5<i>6<i>6]");
+                + "[(5-6)s:d|i:d|_6$<i>5<i>6|<>:e2$<b>64<i>5<i>6<i>6<b>0]");
         return fd;
     }
 
@@ -193,7 +194,7 @@
         fd = new FieldDocument();
         fd.addString("ID", "doc-1");
         fd.addTV("base", "babaa", "[(0-1)s:b|i:b|s:c|_1$<i>0<i>1]"
-                + "[(1-2)s:a|i:a|s:b|_2$<i>1<i>2|<>:e$<b>64<i>1<i>3<i>3]"
+                + "[(1-2)s:a|i:a|s:b|_2$<i>1<i>2|<>:e$<b>64<i>1<i>3<i>3<b>0]"
                 + "[(2-3)s:b|i:b|s:a|_3$<i>2<i>3]"
                 + "[(3-4)s:a|i:a|_4$<i>3<i>4]" + "[(4-5)s:a|i:a|_5$<i>4<i>5]");
         return fd;
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestSegmentNegationIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestSegmentNegationIndex.java
index 7554b20..f30450c 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestSegmentNegationIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestSegmentNegationIndex.java
@@ -2,24 +2,16 @@
 
 import static org.junit.Assert.assertEquals;
 
-import java.io.IOException;
-
-import org.apache.lucene.index.Term;
 import org.apache.lucene.search.spans.SpanQuery;
-import org.apache.lucene.search.spans.SpanTermQuery;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.JUnit4;
 import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import de.ids_mannheim.korap.KrillIndex;
-import de.ids_mannheim.korap.response.Result;
-import de.ids_mannheim.korap.query.SpanElementQuery;
-import de.ids_mannheim.korap.query.SpanNextQuery;
-import de.ids_mannheim.korap.query.SpanSegmentQuery;
 import de.ids_mannheim.korap.query.wrap.SpanSegmentQueryWrapper;
 import de.ids_mannheim.korap.query.wrap.SpanSequenceQueryWrapper;
+import de.ids_mannheim.korap.response.Result;
 
 @RunWith(JUnit4.class)
 public class TestSegmentNegationIndex {
@@ -84,12 +76,13 @@
     private FieldDocument createFieldDoc0 () {
         fd = new FieldDocument();
         fd.addString("ID", "doc-0");
-        fd.addTV("base", "bcbabd", "[(0-1)s:b|i:b|_1#0-1]"
-                + "[(1-2)s:c|i:c|s:b|_2#1-2]"
-                + "[(2-3)s:b|i:b|_3#2-3|<>:e#2-4$<i>4]"
-                + "[(3-4)s:a|i:a|_4#3-4|<>:e#3-5$<i>5|<>:e2#3-5$<i>5]"
-                + "[(4-5)s:b|i:b|s:c|_5#4-5]"
-                + "[(5-6)s:d|i:d|_6#5-6|<>:e2#5-6$<i>6]");
+        fd.addTV("base", "bcbabd", "[(0-1)s:b|i:b|_1$<i>0<i>1]"
+                + "[(1-2)s:c|i:c|s:b|_2$<i>1<i>2]"
+                + "[(2-3)s:b|i:b|_3$<i>2<i>3|<>:e$<b>64<i>2<i>4<i>4<b>0]"
+                + "[(3-4)s:a|i:a|_4$<i>3<i>4|<>:e$<b>64<i>3<i>5<i>5<b>0|"
+                + "<>:e2$<b>64<i>3<i>5<i>5<b>0]"
+                + "[(4-5)s:b|i:b|s:c|_5$<i>4<i>5]"
+                + "[(5-6)s:d|i:d|_6$<i>5<i>6|<>:e2$<b>64<i>5<i>6<i>6<b>0]");
         return fd;
     }
 
@@ -97,10 +90,10 @@
     private FieldDocument createFieldDoc1 () {
         fd = new FieldDocument();
         fd.addString("ID", "doc-1");
-        fd.addTV("base", "babaa", "[(0-1)s:b|i:b|s:c|_1#0-1]"
-                + "[(1-2)s:a|i:a|s:b|_2#1-2|<>:e#1-3$<i>3]"
-                + "[(2-3)s:b|i:b|s:a|_3#2-3]" + "[(3-4)s:a|i:a|_4#3-4]"
-                + "[(4-5)s:a|i:a|_5#4-5]");
+        fd.addTV("base", "babaa", "[(0-1)s:b|i:b|s:c|_1$<i>0<i>1]"
+                + "[(1-2)s:a|i:a|s:b|_2$<i>1<i>2|<>:e$<b>64<i>1<i>3<i>3<b>0]"
+                + "[(2-3)s:b|i:b|s:a|_3$<i>2<i>3]"
+                + "[(3-4)s:a|i:a|_4$<i>3<i>4]" + "[(4-5)s:a|i:a|_5$<i>4<i>5]");
         return fd;
     }
 
@@ -108,8 +101,9 @@
     private FieldDocument createFieldDoc2 () {
         fd = new FieldDocument();
         fd.addString("ID", "doc-2");
-        fd.addTV("base", "bdb", "[(0-1)s:b|i:b|_1#0-1]"
-                + "[(1-2)s:d|i:d|s:b|_2#1-2]" + "[(2-3)s:b|i:b|s:a|_3#2-3]");
+        fd.addTV("base", "bdb", "[(0-1)s:b|i:b|_1$<i>0<i>1]"
+                + "[(1-2)s:d|i:d|s:b|_2$<i>1<i>2]"
+                + "[(2-3)s:b|i:b|s:a|_3$<i>2<i>3]");
         return fd;
     }
 
@@ -117,8 +111,8 @@
     private FieldDocument createFieldDoc3 () {
         fd = new FieldDocument();
         fd.addString("ID", "doc-3");
-        fd.addTV("base", "bdb", "[(0-1)s:b|i:b|s:c|_1#0-1]"
-                + "[(1-2)s:d|_2#1-2]" + "[(2-3)s:d|i:d|_3#2-3]");
+        fd.addTV("base", "bdb", "[(0-1)s:b|i:b|s:c|_1$<i>0<i>1]"
+                + "[(1-2)s:d|_2$<i>1<i>2]" + "[(2-3)s:d|i:d|_3$<i>2<i>3]");
         return fd;
     }
 }
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java
index 3ed9dc6..be93679 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java
@@ -17,11 +17,11 @@
 
 import de.ids_mannheim.korap.KrillIndex;
 import de.ids_mannheim.korap.KrillQuery;
-import de.ids_mannheim.korap.response.Result;
 import de.ids_mannheim.korap.query.SpanElementQuery;
 import de.ids_mannheim.korap.query.SpanExpansionQuery;
 import de.ids_mannheim.korap.query.SpanRepetitionQuery;
 import de.ids_mannheim.korap.query.wrap.SpanQueryWrapper;
+import de.ids_mannheim.korap.response.Result;
 import de.ids_mannheim.korap.util.QueryException;
 
 public class TestSpanExpansionIndex {
@@ -352,12 +352,12 @@
     private FieldDocument createFieldDoc0 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-0");
-        fd.addTV("base", "ceccecdeec", "[(0-1)s:c|_0#0-1]"
-                + "[(1-2)s:e|_1#1-2]" + "[(2-3)s:c|_2#2-3]"
-                + "[(3-4)s:c|s:d|_3#3-4]" + "[(4-5)s:e|_4#4-5]"
-                + "[(5-6)s:c|_5#5-6]" + "[(6-7)s:d|_6#6-7]"
-                + "[(7-8)s:e|_7#7-8]" + "[(8-9)s:e|_8#8-9]"
-                + "[(9-10)s:c|_9#9-10]");
+        fd.addTV("base", "ceccecdeec", "[(0-1)s:c|_0$<i>0<i>1]"
+                + "[(1-2)s:e|_1$<i>1<i>2]" + "[(2-3)s:c|_2$<i>2<i>3]"
+                + "[(3-4)s:c|s:d|_3$<i>3<i>4]" + "[(4-5)s:e|_4$<i>4<i>5]"
+                + "[(5-6)s:c|_5$<i>5<i>6]" + "[(6-7)s:d|_6$<i>6<i>7]"
+                + "[(7-8)s:e|_7$<i>7<i>8]" + "[(8-9)s:e|_8$<i>8<i>9]"
+                + "[(9-10)s:c|_9$<i>9<i>10]");
         return fd;
     }
 
@@ -365,10 +365,10 @@
     private FieldDocument createFieldDoc1 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-1");
-        fd.addTV("base", "bbccdd", "[(0-1)s:b|s:c|_0#0-1]"
-                + "[(1-2)s:b|_1#1-2]" + "[(2-3)s:c|_2#2-3]"
-                + "[(3-4)s:c|_3#3-4]" + "[(4-5)s:d|_4#4-5]"
-                + "[(5-6)s:d|_5#5-6]");
+        fd.addTV("base", "bbccdd", "[(0-1)s:b|s:c|_0$<i>0<i>1]"
+                + "[(1-2)s:b|_1$<i>1<i>2]" + "[(2-3)s:c|_2$<i>2<i>3]"
+                + "[(3-4)s:c|_3$<i>3<i>4]" + "[(4-5)s:d|_4$<i>4<i>5]"
+                + "[(5-6)s:d|_5$<i>5<i>6]");
         return fd;
     }
 
@@ -376,10 +376,10 @@
     private FieldDocument createFieldDoc2 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-2");
-        fd.addTV("base", "beccea", "[(0-1)s:b|s:c|_0#0-1]"
-                + "[(1-2)s:e|_1#1-2]" + "[(2-3)s:c|_2#2-3]"
-                + "[(3-4)s:c|_3#3-4]" + "[(4-5)s:e|_4#4-5]"
-                + "[(5-6)s:a|_5#5-6]");
+        fd.addTV("base", "beccea", "[(0-1)s:b|s:c|_0$<i>0<i>1]"
+                + "[(1-2)s:e|_1$<i>1<i>2]" + "[(2-3)s:c|_2$<i>2<i>3]"
+                + "[(3-4)s:c|_3$<i>3<i>4]" + "[(4-5)s:e|_4$<i>4<i>5]"
+                + "[(5-6)s:a|_5$<i>5<i>6]");
         return fd;
     }
 
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestUnorderedDistanceIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestUnorderedDistanceIndex.java
index 3de9dc9..b94dc60 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestUnorderedDistanceIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestUnorderedDistanceIndex.java
@@ -30,13 +30,13 @@
         fd.addString("ID", "doc-0");
         fd.addTV("base", "text", "[(0-1)s:c|_1$<i>0<i>1]"
                 + "[(1-2)s:e|_2$<i>1<i>2]"
-                + "[(2-3)s:c|_3$<i>2<i>3|<>:y$<b>64<i>2<i>4<i>4]"
-                + "[(3-4)s:c|_4$<i>3<i>4|<>:x$<b>64<i>3<i>7<i>7]"
-                + "[(4-5)s:d|_5$<i>4<i>5|<>:y$<b>64<i>4<i>6<i>6]"
-                + "[(5-6)s:c|_6$<i>5<i>6|<>:y$<b>64<i>5<i>8<i>8]"
+                + "[(2-3)s:c|_3$<i>2<i>3|<>:y$<b>64<i>2<i>4<i>4<b>0]"
+                + "[(3-4)s:c|_4$<i>3<i>4|<>:x$<b>64<i>3<i>7<i>7<b>0]"
+                + "[(4-5)s:d|_5$<i>4<i>5|<>:y$<b>64<i>4<i>6<i>6<b>0]"
+                + "[(5-6)s:c|_6$<i>5<i>6|<>:y$<b>64<i>5<i>8<i>8<b>0]"
                 + "[(6-7)s:d|_7$<i>6<i>7]"
-                + "[(7-8)s:f|_8$<i>7<i>8|<>:x$<b>64<i>7<i>9<i>9]"
-                + "[(8-9)s:e|_9$<i>8<i>9|<>:x$<b>64<i>8<i>10<i>10]"
+                + "[(7-8)s:f|_8$<i>7<i>8|<>:x$<b>64<i>7<i>9<i>9<b>0]"
+                + "[(8-9)s:e|_9$<i>8<i>9|<>:x$<b>64<i>8<i>10<i>10<b>0]"
                 + "[(9-10)s:d|_10$<i>9<i>10]");
         return fd;
     }
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestUnorderedElementDistanceIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestUnorderedElementDistanceIndex.java
index cb8b84e..d3d1c4d 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestUnorderedElementDistanceIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestUnorderedElementDistanceIndex.java
@@ -29,13 +29,13 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-0");
         fd.addTV("base", "text",
-                "[(0-1)s:b|s:c|_1$<i>0<i>1|<>:s$<b>64<i>0<i>2<i>1]"
+                "[(0-1)s:b|s:c|_1$<i>0<i>1|<>:s$<b>64<i>0<i>2<i>1<b>0]"
                         + "[(1-2)s:b|_2$<i>1<i>2]"
-                        + "[(2-3)s:b|_3$<i>2<i>3|<>:s$<b>64<i>2<i>3<i>3]"
-                        + "[(3-4)s:c|_4$<i>3<i>4|<>:s$<b>64<i>3<i>4<i>4]"
-                        + "[(4-5)s:b|_5$<i>4<i>5|<>:s$<b>64<i>4<i>5<i>5]"
+                        + "[(2-3)s:b|_3$<i>2<i>3|<>:s$<b>64<i>2<i>3<i>3<b>0]"
+                        + "[(3-4)s:c|_4$<i>3<i>4|<>:s$<b>64<i>3<i>4<i>4<b>0]"
+                        + "[(4-5)s:b|_5$<i>4<i>5|<>:s$<b>64<i>4<i>5<i>5<b>0]"
                         + "[(5-6)s:b|_6$<i>5<i>6]"
-                        + "[(6-7)s:c|_7$<i>6<i>7|<>:s$<b>64<i>6<i>7<i>7]");
+                        + "[(6-7)s:c|_7$<i>6<i>7|<>:s$<b>64<i>6<i>7<i>7<b>0]");
         return fd;
     }
 
@@ -44,10 +44,10 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-1");
         fd.addTV("base", "text",
-                "[(0-1)s:b|_1$<i>0<i>1|<>:s$<b>64<i>0<i>2<i>1]"
-                        + "[(1-2)s:c|_2$<i>1<i>2|<>:s$<b>64<i>1<i>2<i>4]"
+                "[(0-1)s:b|_1$<i>0<i>1|<>:s$<b>64<i>0<i>2<i>1<b>0]"
+                        + "[(1-2)s:c|_2$<i>1<i>2|<>:s$<b>64<i>1<i>2<i>4<b>0]"
                         + "[(2-3)s:e|_3$<i>2<i>3]" + "[(3-4)s:c|_4$<i>3<i>4]"
-                        + "[(4-5)s:b|_5$<i>4<i>5|<>:s$<b>64<i>4<i>5<i>7]"
+                        + "[(4-5)s:b|_5$<i>4<i>5|<>:s$<b>64<i>4<i>5<i>7<b>0]"
                         + "[(5-6)s:e|_6$<i>5<i>6]" + "[(6-7)s:e|_7$<i>6<i>7]");
         return fd;
     }
@@ -57,14 +57,14 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-2");
         fd.addTV("base", "text",
-                "[(0-1)s:e|_1$<i>0<i>1|<>:p$<b>64<i>0<i>2<i>1]"
-                        + "[(1-2)s:e|_2$<i>1<i>2|<>:p$<b>64<i>1<i>2<i>2]"
-                        + "[(2-3)s:c|_3$<i>2<i>3|<>:p$<b>64<i>2<i>3<i>3]"
-                        + "[(3-4)s:e|_4$<i>3<i>4|<>:p$<b>64<i>3<i>4<i>4]"
-                        + "[(4-5)s:b|_5$<i>4<i>5|<>:p$<b>64<i>4<i>5<i>5]"
-                        + "[(5-6)s:c|_6$<i>5<i>6|<>:p$<b>64<i>5<i>6<i>6]"
-                        + "[(6-7)s:e|_7$<i>6<i>7|<>:p$<b>64<i>6<i>7<i>7]"
-                        + "[(7-8)s:b|_8$<i>7<i>8|<>:p$<b>64<i>7<i>8<i>8]");
+                "[(0-1)s:e|_1$<i>0<i>1|<>:p$<b>64<i>0<i>2<i>1<b>0]"
+                        + "[(1-2)s:e|_2$<i>1<i>2|<>:p$<b>64<i>1<i>2<i>2<b>0]"
+                        + "[(2-3)s:c|_3$<i>2<i>3|<>:p$<b>64<i>2<i>3<i>3<b>0]"
+                        + "[(3-4)s:e|_4$<i>3<i>4|<>:p$<b>64<i>3<i>4<i>4<b>0]"
+                        + "[(4-5)s:b|_5$<i>4<i>5|<>:p$<b>64<i>4<i>5<i>5<b>0]"
+                        + "[(5-6)s:c|_6$<i>5<i>6|<>:p$<b>64<i>5<i>6<i>6<b>0]"
+                        + "[(6-7)s:e|_7$<i>6<i>7|<>:p$<b>64<i>6<i>7<i>7<b>0]"
+                        + "[(7-8)s:b|_8$<i>7<i>8|<>:p$<b>64<i>7<i>8<i>8<b>0]");
         return fd;
     }
 
@@ -73,8 +73,8 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-3");
         fd.addTV("base", "text",
-                "[(0-1)s:a|_1$<i>0<i>1|<>:s$<b>64<i>0<i>2<i>1]"
-                        + "[(1-2)s:d|_2$<i>1<i>2|<>:s$<b>64<i>1<i>2<i>3]"
+                "[(0-1)s:a|_1$<i>0<i>1|<>:s$<b>64<i>0<i>2<i>1<b>0]"
+                        + "[(1-2)s:d|_2$<i>1<i>2|<>:s$<b>64<i>1<i>2<i>3<b>0]"
                         + "[(2-3)s:e|_3$<i>2<i>3]");
         return fd;
     }
@@ -84,10 +84,10 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-4");
         fd.addTV("base", "text",
-                "[(0-1)s:c|_1$<i>0<i>1|<>:s$<b>64<i>0<i>2<i>2]"
+                "[(0-1)s:c|_1$<i>0<i>1|<>:s$<b>64<i>0<i>2<i>2<b>0]"
                         + "[(1-2)s:e|_2$<i>1<i>2]"
-                        + "[(2-3)s:b|_3$<i>2<i>3|<>:s$<b>64<i>2<i>3<i>3]"
-                        + "[(3-4)s:e|_4$<i>3<i>4|<>:s$<b>64<i>3<i>4<i>4]");
+                        + "[(2-3)s:b|_3$<i>2<i>3|<>:s$<b>64<i>2<i>3<i>3<b>0]"
+                        + "[(3-4)s:e|_4$<i>3<i>4|<>:s$<b>64<i>3<i>4<i>4<b>0]");
         return fd;
     }
 
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestWithinIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestWithinIndex.java
index 0c6582c..a43ce0b 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestWithinIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestWithinIndex.java
@@ -43,9 +43,9 @@
         // <a>x<a>y<a>zhij</a>hij</a>hij</a>
         FieldDocument fd = new FieldDocument();
         fd.addTV("base", "x   y   z   h   i   j   h   i   j   h   i   j   ",
-                "[(0-3)s:x|<>:a$<b>64<i>0<i>36<i>12]" + // 1
-                        "[(3-6)s:y|<>:a$<b>64<i>3<i>27<i>9]" + // 2
-                        "[(6-9)s:z|<>:a$<b>64<i>6<i>18<i>6]" + // 3
+                "[(0-3)s:x|<>:a$<b>64<i>0<i>36<i>12<b>0]" + // 1
+                        "[(3-6)s:y|<>:a$<b>64<i>3<i>27<i>9<b>0]" + // 2
+                        "[(6-9)s:z|<>:a$<b>64<i>6<i>18<i>6<b>0]" + // 3
                         "[(9-12)s:h]" +   // 4
                         "[(12-15)s:i]" +  // 5
                         "[(15-18)s:j]" +  // 6
@@ -94,9 +94,9 @@
         // <a>x<a>y<a>zhij</a>hij</a>hij</a>
         FieldDocument fd = new FieldDocument();
         fd.addTV("base", "x   y   z   h   i   j   h   i   j   h   i   j   ",
-                "[(0-3)s:x|<>:a$<b>64<i>0<i>36<i>12]" + // 1
-                        "[(3-6)s:y|<>:a$<b>64<i>3<i>27<i>9]" + // 2
-                        "[(6-9)s:z|<>:a$<b>64<i>6<i>18<i>6]" + // 3
+                "[(0-3)s:x|<>:a$<b>64<i>0<i>36<i>12<b>0]" + // 1
+                        "[(3-6)s:y|<>:a$<b>64<i>3<i>27<i>9<b>0]" + // 2
+                        "[(6-9)s:z|<>:a$<b>64<i>6<i>18<i>6<b>0]" + // 3
                         "[(9-12)s:h]" +   // 4
                         "[(12-15)s:i]" +  // 5
                         "[(15-18)s:j]" +  // 6
@@ -111,9 +111,9 @@
         // <a>x<a>y<a>zhij</a>hij</a>hij</a>
         fd = new FieldDocument();
         fd.addTV("base", "x   y   z   h   i   j   h   i   j   h   i   j   ",
-                "[(0-3)s:x|<>:a$<b>64<i>0<i>36<i>12]" + // 1
-                        "[(3-6)s:y|<>:a$<b>64<i>3<i>27<i>9]" + // 2
-                        "[(6-9)s:z|<>:a$<b>64<i>6<i>18<i>6]" + // 3
+                "[(0-3)s:x|<>:a$<b>64<i>0<i>36<i>12<b>0]" + // 1
+                        "[(3-6)s:y|<>:a$<b>64<i>3<i>27<i>9<b>0]" + // 2
+                        "[(6-9)s:z|<>:a$<b>64<i>6<i>18<i>6<b>0]" + // 3
                         "[(9-12)s:h]" +   // 4
                         "[(12-15)s:i]" +  // 5
                         "[(15-18)s:j]" +  // 6
@@ -196,9 +196,9 @@
         // <a>x<a>y<a>zhij</a>hij</a>hij</a>
         FieldDocument fd = new FieldDocument();
         fd.addTV("base", "x   y   z   h   i   j   h   i   j   h   i   j   ",
-                "[(0-3)s:x|<>:a$<b>64<i>0<i>36<i>12]" + // 1
-                        "[(3-6)s:y|<>:a$<b>64<i>3<i>27<i>9]" + // 2
-                        "[(6-9)s:z|<>:a$<b>64<i>6<i>18<i>6]" + // 3
+                "[(0-3)s:x|<>:a$<b>64<i>0<i>36<i>12<b>0]" + // 1
+                        "[(3-6)s:y|<>:a$<b>64<i>3<i>27<i>9<b>0]" + // 2
+                        "[(6-9)s:z|<>:a$<b>64<i>6<i>18<i>6<b>0]" + // 3
                         "[(9-12)s:h]" +   // 4
                         "[(12-15)s:i]" +  // 5
                         "[(15-18)s:j]" +  // 6
@@ -213,9 +213,9 @@
         // <a>x<a>y<a>zabc</a>abc</a>abc</a>
         fd = new FieldDocument();
         fd.addTV("base", "x   y   z   a   b   c   a   b   c   a   b   c   ",
-                "[(0-3)s:x|<>:a$<b>64<i>0<i>36<i>12]" + // 1
-                        "[(3-6)s:y|<>:a$<b>64<i>3<i>27<i>9]" + // 2
-                        "[(6-9)s:z|<>:a$<b>64<i>6<i>18<i>6]" + // 3
+                "[(0-3)s:x|<>:a$<b>64<i>0<i>36<i>12<b>0]" + // 1
+                        "[(3-6)s:y|<>:a$<b>64<i>3<i>27<i>9<b>0]" + // 2
+                        "[(6-9)s:z|<>:a$<b>64<i>6<i>18<i>6<b>0]" + // 3
                         "[(9-12)s:a]" +   // 4
                         "[(12-15)s:b]" +  // 5
                         "[(15-18)s:c]" +  // 6
@@ -271,9 +271,9 @@
         // <a>x<a>y<a>zhij</a>hij</a>hij</a>
         FieldDocument fd = new FieldDocument();
         fd.addTV("base", "x   y   z   h   i   j   h   i   j   h   i   j   ",
-                "[(0-3)s:x|<>:a$<b>64<i>0<i>36<i>12]" + // 1
-                        "[(3-6)s:y|<>:a$<b>64<i>3<i>27<i>9]" + // 2
-                        "[(6-9)s:z|<>:a$<b>64<i>6<i>18<i>6]" + // 3
+                "[(0-3)s:x|<>:a$<b>64<i>0<i>36<i>12<b>0]" + // 1
+                        "[(3-6)s:y|<>:a$<b>64<i>3<i>27<i>9<b>0]" + // 2
+                        "[(6-9)s:z|<>:a$<b>64<i>6<i>18<i>6<b>0]" + // 3
                         "[(9-12)s:h]" +   // 4
                         "[(12-15)s:i]" +  // 5
                         "[(15-18)s:j]" +  // 6
@@ -295,9 +295,9 @@
         // <a>x<a>y<a>zabc</a>abc</a>abc</a>
         fd = new FieldDocument();
         fd.addTV("base", "x   y   z   a   b   c   a   b   c   a   b   c   ",
-                "[(0-3)s:x|<>:a$<b>64<i>0<i>36<i>12]" + // 1
-                        "[(3-6)s:y|<>:a$<b>64<i>3<i>27<i>9]" + // 2
-                        "[(6-9)s:z|<>:a$<b>64<i>6<i>18<i>6]" + // 3
+                "[(0-3)s:x|<>:a$<b>64<i>0<i>36<i>12<b>0]" + // 1
+                        "[(3-6)s:y|<>:a$<b>64<i>3<i>27<i>9<b>0]" + // 2
+                        "[(6-9)s:z|<>:a$<b>64<i>6<i>18<i>6<b>0]" + // 3
                         "[(9-12)s:a]" +   // 4
                         "[(12-15)s:b]" +  // 5
                         "[(15-18)s:c]" +  // 6
@@ -357,7 +357,9 @@
         fd.addTV("base",
                 // <a><a>hhij</a>hijh</a>ij</a>
                 "h  h  i  j  h  i  j  h  i  j        ",
-                "[s:h|_0$<i>0<i>3|<>:a$<b>64<i>0<i>12<i>3|<>:a$<b>64<i>0<i>24<i>7|<>:a$<b>64<i>0<i>30<i>9]"
+                "[s:h|_0$<i>0<i>3|<>:a$<b>64<i>0<i>12<i>3<b>0|"
+                        + "<>:a$<b>64<i>0<i>24<i>7<b>0|"
+                        + "<>:a$<b>64<i>0<i>30<i>9<b>0]"
                         + // 1
                         "[s:h|_1$<i>3<i>6]" + // 2
                         "[s:i|_2$<i>6<i>9]" + // 3
@@ -429,7 +431,9 @@
         // <a><a><a>h</a>hij</a>hij</a>h
         FieldDocument fd = new FieldDocument();
         fd.addTV("base", "h  h  i  j  h  i  j  h  i  j  h  ",
-                "[(0-3)s:h|<>:a$<b>64<i>0<i>12<i>3|<>:a$<b>64<i>0<i>21<i>6|<>:a$<b>64<i>0<i>30<i>9]"
+                "[(0-3)s:h|<>:a$<b>64<i>0<i>12<i>3<b>0|"
+                        + "<>:a$<b>64<i>0<i>21<i>6<b>0|"
+                        + "<>:a$<b>64<i>0<i>30<i>9<b>0]"
                         + // 1
                         "[(3-6)s:h]" +    // 2
                         "[(6-9)s:i]" +    // 3
@@ -494,7 +498,9 @@
         // <a><a><a>h</a>hij</a>hij</a>h<a>i</i>
         FieldDocument fd = new FieldDocument();
         fd.addTV("base", "h  h  i  j  h  i  j  h  i  j  h  i  ",
-                "[(0-3)s:h|<>:a$<b>64<i>0<i>15<i>4|<>:a$<b>64<i>0<i>21<i>7|<>:a$<b>64<i>0<i>30<i>10]"
+                "[(0-3)s:h|<>:a$<b>64<i>0<i>15<i>4<b>0|"
+                        + "<>:a$<b>64<i>0<i>21<i>7<b>0|"
+                        + "<>:a$<b>64<i>0<i>30<i>10<b>0]"
                         + // 1
                         "[(3-6)s:h]" +    // 2
                         "[(6-9)s:i]" +  // 3
@@ -506,7 +512,7 @@
                         "[(24-27)s:i]" +  // 9
                         "[(27-30)s:j]" +  // 10
                         "[(30-33)s:h]" +  // 11
-                        "[(33-36)s:i|<>:a$<b>64<i>33<i>36<i>12]"); // 12
+                        "[(33-36)s:i|<>:a$<b>64<i>33<i>36<i>12<b>0]"); // 12
         ki.addDoc(fd);
 
         // Save documents
@@ -567,7 +573,9 @@
         // <a><a><a>h</a>hij</a>hij</a>h<a>h</h>
         FieldDocument fd = new FieldDocument();
         fd.addTV("base", "h  h  i  j  h  i  j  h  i  j  h  h  ",
-                "[(0-3)s:h|_0$<i>0<i>3|<>:a$<b>64<i>0<i>15<i>4|<>:a$<b>64<i>0<i>18<i>6|<>:a$<b>64<i>0<i>27<i>8]"
+                "[(0-3)s:h|_0$<i>0<i>3|<>:a$<b>64<i>0<i>15<i>4<b>0|"
+                        + "<>:a$<b>64<i>0<i>18<i>6<b>0|"
+                        + "<>:a$<b>64<i>0<i>27<i>8<b>0]"
                         + // 1
                         "[(3-6)s:h|_1$<i>3<i>6]"
                         + // 2
@@ -587,9 +595,9 @@
                         + // 9
                         "[(27-30)s:j|_9$<i>27<i>30]"
                         + // 10
-                        "[(30-33)s:h|_10$<i>30<i>33|<>:a$<b>64<i>30<i>36<i>12]"
+                        "[(30-33)s:h|_10$<i>30<i>33|<>:a$<b>64<i>30<i>36<i>12<b>0]"
                         + // 11
-                        "[(33-36)s:h|_11$<i>33<i>36|<>:a$<b>64<i>33<i>36<i>12]"); // 12
+                        "[(33-36)s:h|_11$<i>33<i>36|<>:a$<b>64<i>33<i>36<i>12<b>0]"); // 12
         ki.addDoc(fd);
 
         // Save documents
@@ -660,15 +668,19 @@
         // <a><a><a>u</a></a></a>
         FieldDocument fd = new FieldDocument();
         fd.addTV("base", "xyz",
-                "[(0-3)s:xyz|<>:a$<b>64<i>0<i>3<i>0|<>:a$<b>64<i>0<i>3<i>0|<>:a$<b>64<i>0<i>3<i>0|<>:b$<b>64<i>0<i>3<i>0]");
+                "[(0-3)s:xyz|<>:a$<b>64<i>0<i>3<i>0<b>0|"
+                + "<>:a$<b>64<i>0<i>3<i>0<b>0|" + "<>:a$<b>64<i>0<i>3<i>0<b>0|"
+                + "<>:b$<b>64<i>0<i>3<i>0<b>0]");
         ki.addDoc(fd);
 
         // <a><b>x<a>y<a>zcde</a>cde</a>cde</b></a>
         fd = new FieldDocument();
         fd.addTV("base", "x   y   z   c   d   e   c   d   e   c   d   e   ",
-                "[(0-3)s:x|<>:a$<b>64<i>0<i>36<i>12|<>:b$<b>64<i>0<i>36<i>12]"
-                        + "[(3-6)s:y|<>:a$<b>64<i>3<i>27<i>9]"
-                        + "[(6-9)s:z|<>:a$<b>64<i>6<i>18<i>6]" + "[(9-12)s:c]"
+                "[(0-3)s:x|<>:a$<b>64<i>0<i>36<i>12<b>0|"
+                        + "<>:b$<b>64<i>0<i>36<i>12<b>0]"
+                        + "[(3-6)s:y|<>:a$<b>64<i>3<i>27<i>9<b>0]"
+                        + "[(6-9)s:z|<>:a$<b>64<i>6<i>18<i>6<b>0]"
+                        + "[(9-12)s:c]"
                         + "[(12-15)s:d]" + "[(15-18)s:e]" + "[(18-21)s:c]"
                         + "[(21-24)s:d]" + "[(24-27)s:e]" + "[(27-30)s:c]"
                         + "[(30-33)s:d]" + "[(33-36)s:e]");
@@ -683,9 +695,11 @@
         // <a>x<a><b>y<a>zcde</a>cde</b></a>cde</a>
         fd = new FieldDocument();
         fd.addTV("base", "x   y   z   k   l   m   k   l   m   k   l   m   ",
-                "[(0-3)s:x|<>:a$<b>64<i>0<i>3<i>12]"
-                        + "[(3-6)s:y|<>:a$<b>64<i>3<i>6<i>9|<>:b$<b>64<i>3<i>6<i>9]"
-                        + "[(6-9)s:z|<>:a$<b>64<i>6<i>9<i>6]" + "[(9-12)s:k]"
+                "[(0-3)s:x|<>:a$<b>64<i>0<i>3<i>12<b>0]"
+                        + "[(3-6)s:y|<>:a$<b>64<i>3<i>6<i>9<b>0|"
+                        + "<>:b$<b>64<i>3<i>6<i>9<b>0]"
+                        + "[(6-9)s:z|<>:a$<b>64<i>6<i>9<i>6<b>0]"
+                        + "[(9-12)s:k]"
                         + "[(12-15)s:l]" + "[(15-18)s:m]" + "[(18-21)s:k]"
                         + "[(21-24)s:l]" + "[(24-27)s:m]" + "[(27-30)s:k]"
                         + "[(30-33)s:l]" + "[(33-36)s:m]");
@@ -695,9 +709,9 @@
         fd = new FieldDocument();
         fd.addTV("base", "h   i   j   h   i   j   h   i   j   ",
                 "[(0-3)s:h|"
-                        + "<>:a$<b>64<i>0<i>18<i>3|" 
-                        + "<>:a$<b>64<i>0<i>27<i>6|" 
-                        + "<>:a$<b>64<i>0<i>36<i>9]"
+                + "<>:a$<b>64<i>0<i>18<i>3<b>0|"
+                + "<>:a$<b>64<i>0<i>27<i>6<b>0|"
+                + "<>:a$<b>64<i>0<i>36<i>9<b>0]"
                         + "[(3-6)s:h]" + "[(12-15)s:i]" + "[(15-18)s:j]"
                         + "[(18-21)s:h]" + "[(21-24)s:i]" + "[(24-27)s:j]"
                         + "[(27-30)s:h]" + "[(30-33)s:i]" + "[(33-36)s:j]");
@@ -758,7 +772,7 @@
         fd.addTV("base", "Er schrie: \"Das war ich!\" und ging.",
                 "[(0-2)s:Er|_0$<i>0<i>3]"
                         + "[(3-9)s:schrie|_1$<i>3<i>9]"
-                        + "[(12-15)s:Das|_2$<i>12<i>15|<>:sentence$<b>64<i>11<i>25<i>5]"
+                        + "[(12-15)s:Das|_2$<i>12<i>15|<>:sentence$<b>64<i>11<i>25<i>5<b>0]"
                         + "[(16-19)s:war|_3$<i>16<i>19]"
                         + "[(20-23)s:ich|_4$<i>20<i>23]"
                         + "[(26-29)s:und|_5$<i>26<i>29]"
@@ -850,9 +864,10 @@
                 "x  y  x  b  c  x  ",
                 "[(0-3)s:x|_0$<i>0<i>3]"
                         + "[(3-6)s:y|_1$<i>3<i>6]"
-                        + "[(6-9)s:x|_2$<i>6<i>9|<>:a$<b>64<i>6<i>9<i>3|<>:a$<b>64<i>6<i>15<i>5]"
+                + "[(6-9)s:x|_2$<i>6<i>9|<>:a$<b>64<i>6<i>9<i>3<b>0|"
+                + "<>:a$<b>64<i>6<i>15<i>5<b>0]"
                         + "[(9-12)s:b|_3$<i>9<i>12]"
-                        + "[(12-15)s:c|_4$<i>12<i>15|<>:a$<b>64<i>12<i>15<i>5]"
+                + "[(12-15)s:c|_4$<i>12<i>15|<>:a$<b>64<i>12<i>15<i>5<b>0]"
                         + "[(15-18)s:x|_5$<i>15<i>18]");
         ki.addDoc(fd);
 
@@ -885,10 +900,10 @@
                 "[(0-1)s:h|i:h|_0$<i>0<i>1|-:a$<i>3|-:t$<i>10]"
                         + "[(1-2)s:i|i:i|_1$<i>1<i>2]"
                         + "[(2-3)s:j|i:j|_2$<i>2<i>3]"
-                        + "[(3-4)s:h|i:h|_3$<i>3<i>4|<>:a$<b>64<i>3<i>10<i>10]"
+                        + "[(3-4)s:h|i:h|_3$<i>3<i>4|<>:a$<b>64<i>3<i>10<i>10<b>0]"
                         + "[(4-5)s:i|i:i|_4$<i>4<i>5]"
-                        + "[(5-6)s:h|i:h|_5$<i>5<i>6|<>:a$<b>64<i>5<i>8<i>8]"
-                        + "[(6-7)s:i|i:i|_6$<i>6<i>7|<>:a$<b>64<i>6<i>8<i>8]"
+                        + "[(5-6)s:h|i:h|_5$<i>5<i>6|<>:a$<b>64<i>5<i>8<i>8<b>0]"
+                        + "[(6-7)s:i|i:i|_6$<i>6<i>7|<>:a$<b>64<i>6<i>8<i>8<b>0]"
                         + "[(7-8)s:j|i:j|_7$<i>7<i>8]"
                         + "[(8-9)s:h|i:h|_8$<i>8<i>9]"
                         + "[(9-10)s:i|i:i|_9$<i>9<i>10]");
@@ -926,12 +941,13 @@
         FieldDocument fd = new FieldDocument();
         fd.addTV("base", "hijhi jh ij",
                 "[(0-1)s:h|i:h|_0$<i>0<i>1|-:a$<i>4|-:t$<i>9]"
-                        + "[(1-2)s:i|i:i|_1$<i>1<i>2|<>:a$<b>64<i>1<i>2<i>2|<>:a$<b>64<i>1<i>3<i>3]"
+                        + "[(1-2)s:i|i:i|_1$<i>1<i>2|<>:a$<b>64<i>1<i>2<i>2<b>0|"
+                        + "<>:a$<b>64<i>1<i>3<i>3<b>0]"
                         + "[(2-3)s:j|i:j|_2$<i>2<i>3]"
-                        + "[(3-4)s:h|i:h|_3$<i>3<i>4|<>:a$<b>64<i>3<i>4<i>4]"
+                        + "[(3-4)s:h|i:h|_3$<i>3<i>4|<>:a$<b>64<i>3<i>4<i>4<b>0]"
                         + "[(4-5)s:i|i:i|_4$<i>4<i>5]"
                         + "[(6-7)s:j|i:j|_5$<i>6<i>7]"
-                        + "[(7-8)s:h|i:h|_6$<i>7<i>8|<>:a$<b>64<i>7<i>10<i>8]"
+                        + "[(7-8)s:h|i:h|_6$<i>7<i>8|<>:a$<b>64<i>7<i>10<i>8<b>0]"
                         + "[(9-10)s:i|i:i|_7$<i>9<i>10]"
                         + "[(10-11)s:j|i:j|_8$<i>10<i>11]");
         ki.addDoc(fd);
@@ -960,12 +976,12 @@
         FieldDocument fd = new FieldDocument();
         fd.addTV("base", "xx hi j hi j",
                 "[(0-1)s:x|i:x|_0$<i>0<i>1|-:a$<i>2|-:t$<i>8]"
-                        + "[(1-2)s:x|i:x|_1$<i>1<i>2|<>:a$<b>64<i>1<i>4<i>3]"
+                        + "[(1-2)s:x|i:x|_1$<i>1<i>2|<>:a$<b>64<i>1<i>4<i>3<b>0]"
                         + "[(3-4)s:h|i:h|_2$<i>3<i>4]"
                         + "[(4-5)s:i|i:i|_3$<i>4<i>5]"
                         + "[(6-7)s:j|i:j|_4$<i>6<i>7]"
                         + "[(8-9)s:h|i:h|_5$<i>8<i>9]"
-                        + "[(9-10)s:i|i:i|_6$<i>9<i>10|<>:a$<b>64<i>9<i>12<i>8]"
+                        + "[(9-10)s:i|i:i|_6$<i>9<i>10|<>:a$<b>64<i>9<i>12<i>8<b>0]"
                         + "[(11-12)s:j|i:j|_7$<i>11<i>12]");
         ki.addDoc(fd);
 
@@ -993,12 +1009,12 @@
         FieldDocument fd = new FieldDocument();
         // <a>xx <e>hi j <e>hi j</e></e></a>
         fd.addTV("base", "xx hi j hi j",
-                "[(0-1)s:x|i:x|_0$<i>0<i>1|<>:a$<b>64<i>1<i>12<i>8]"
+                "[(0-1)s:x|i:x|_0$<i>0<i>1|<>:a$<b>64<i>1<i>12<i>8<b>0]"
                         + "[(1-2)s:x|i:x|_1$<i>1<i>2]"
-                        + "[(3-4)s:h|i:h|_2$<i>3<i>4|<>:e$<b>64<i>3<i>12<i>8]"
+                        + "[(3-4)s:h|i:h|_2$<i>3<i>4|<>:e$<b>64<i>3<i>12<i>8<b>0]"
                         + "[(4-5)s:i|i:i|_3$<i>4<i>5]"
                         + "[(6-7)s:j|i:j|_4$<i>6<i>7]"
-                        + "[(8-9)s:h|i:h|_5$<i>8<i>9|<>:e$<b>64<i>8<i>9<i>8]"
+                        + "[(8-9)s:h|i:h|_5$<i>8<i>9|<>:e$<b>64<i>8<i>9<i>8<b>0]"
                         + "[(9-10)s:i|i:i|_6$<i>9<i>10]"
                         + "[(11-12)s:j|i:j|_7$<i>11<i>12]");
         ki.addDoc(fd);