Fixed check for TUIs in relation spans

Change-Id: Iaa76f354f35d1092c10965eb79aff3776ed707cc
diff --git a/misc/payloads.md b/misc/payloads.md
index 5162126..d4ac3e8 100644
--- a/misc/payloads.md
+++ b/misc/payloads.md
@@ -143,7 +143,7 @@
 * 1 integer for the start span offset of the left part, 
 * 1 integer for the end span offset of the left part, 
 * 1 integer for end position of the left part, 
-* 1 integer for end position of the right part, and 
+* 1 integer for token position of the right part, and 
 * and 0-3 TUIs as above.
 
 For example:
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/RelationSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/RelationSpans.java
index a10e770..5ea240a 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/RelationSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/RelationSpans.java
@@ -219,7 +219,7 @@
             }
         }
         else if (payloadTypeIdentifier == PayloadTypeIdentifier.ELEMENT_TO_TERM.value) { // length
-            // 15
+            // 17
             // 1-4 start element offset
             // 5-8 end element offset
             cs.setEnd(bb.getInt(9));
@@ -227,14 +227,14 @@
             i = bb.getInt(13);
             cs.setRightStart(i);
             cs.setRightEnd(i + 1);
-            if (length > 13) {
+            if (length > 17) {
                 cs.setLeftId(bb.getShort(17)); // left id
                 cs.setRightId(bb.getShort(19)); // right id
                 cs.setSpanId(bb.getShort(21)); // relation id
             }
         }
         else if (payloadTypeIdentifier == PayloadTypeIdentifier.ELEMENT_TO_ELEMENT.value) {
-            // length 19
+            // 19
 
             // 1-4 start left-element offset
             // 5-8 end left-element offset