diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/ElementSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/ElementSpans.java
index ba056d1..44ac329 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/ElementSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/ElementSpans.java
@@ -141,7 +141,10 @@
             bb.put(payload.get(0));
 
             this.payloadTypeIdentifier = bb.get(0);
-            this.matchEndPosition = bb.getInt(9);
+
+            if (payloadTypeIdentifier == PayloadTypeIdentifier.ELEMENT.value) {
+				this.matchEndPosition = bb.getInt(9);
+			};
 
             if (payloadTypeIdentifier == PayloadTypeIdentifier.ELEMENT.value
                     && length > 15) {
@@ -161,7 +164,7 @@
             return;
         }
 
-        this.matchEndPosition = this.matchStartPosition;
+		this.matchEndPosition = this.matchStartPosition;
         this.setSpanId((short) -1);
         this.hasSpanId = false;
         this.matchPayload = null;
diff --git a/src/main/java/de/ids_mannheim/korap/response/Match.java b/src/main/java/de/ids_mannheim/korap/response/Match.java
index 4bf7109..0c89010 100644
--- a/src/main/java/de/ids_mannheim/korap/response/Match.java
+++ b/src/main/java/de/ids_mannheim/korap/response/Match.java
@@ -57,7 +57,7 @@
     private final static Logger log = LoggerFactory.getLogger(Match.class);
 
     // This advices the java compiler to ignore all loggings
-    public static final boolean DEBUG = false;
+    public static final boolean DEBUG = true;
 
     // Mapper for JSON serialization
     ObjectMapper mapper = new ObjectMapper();
@@ -989,6 +989,10 @@
         // First element of sorted array
         HighlightCombinatorElement elem = this.snippetArray.getFirst();
 
+		// Untested
+		if (elem == null)
+			return null;
+		
         // Create context
         sb.append("<span class=\"context-left\">");
         if (this.startMore)
@@ -1017,14 +1021,19 @@
             // decrement end
             end--;
         };
-        if (this.endMore)
+
+		if (this.endMore)
             rightContext.append("<span class=\"more\"></span>");
+
         rightContext.append("</span>");
 
         // Iterate through all remaining elements
         sb.append("<span class=\"match\">");
         for (short i = start; i <= end; i++) {
-            sb.append(this.snippetArray.get(i).toHTML(this, level, levelCache));
+			elem = this.snippetArray.get(i);
+			// UNTESTED
+			if (elem != null)
+				sb.append(elem.toHTML(this, level, levelCache));
         };
         sb.append("</span>");
         sb.append(rightContext);
diff --git a/src/test/java/de/ids_mannheim/korap/highlight/TestHighlight.java b/src/test/java/de/ids_mannheim/korap/highlight/TestHighlight.java
index 5507a89..a749606 100644
--- a/src/test/java/de/ids_mannheim/korap/highlight/TestHighlight.java
+++ b/src/test/java/de/ids_mannheim/korap/highlight/TestHighlight.java
@@ -403,4 +403,50 @@
                         + "<span class=\"context-right\"></span>",
                 km.getSnippetHTML());
     };
+
+	
+    @Test
+    public void highlightEmptySpan () throws IOException, QueryException {
+
+        KrillIndex ki = new KrillIndex();
+
+		// <>:s$<b>65<i>38<b>0
+        // <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<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|<>:a$<b>65<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]");
+        ki.addDoc(fd);
+
+        // Commit!
+        ki.commit();
+        QueryBuilder kq = new QueryBuilder("base");
+        SpanQuery q = (SpanQuery) kq.tag("a").toQuery();
+
+		Krill qs = new Krill(q);
+        qs.getMeta().getContext().left.setToken(true).setLength((short) 5);
+        qs.getMeta().getContext().right.setToken(true).setLength((short) 5);
+
+        Result kr = ki.search(qs);
+        assertEquals((long) 4, kr.getTotalResults());
+
+		Match km = kr.getMatch(2);
+		assertEquals(
+			"<span class=\"context-left\">"+
+			"</span>"+
+			"<span class=\"match\">"+
+			"<mark>x  y  z  </mark>"+
+			"</span><span class=\"context-right\">h  i  j  h  i  j  h  i  j  </span>",
+			km.getSnippetHTML());
+
+		km = kr.getMatch(3);
+		assertEquals(
+			"",
+			km.getSnippetHTML());
+
+	};
 };
