diff --git a/src/main/java/de/ids_mannheim/korap/KorapIndex.java b/src/main/java/de/ids_mannheim/korap/KorapIndex.java
index 2f104a0..6d23202 100644
--- a/src/main/java/de/ids_mannheim/korap/KorapIndex.java
+++ b/src/main/java/de/ids_mannheim/korap/KorapIndex.java
@@ -1198,9 +1198,14 @@
 		    match.internalDocID = docID;
 		    match.populateDocument(doc, field, fieldsToLoadLocal);
 		    
-		    if (DEBUG)
-			log.trace("I've got a match in {} of {}",
-				  match.getDocID(), count);
+		    if (DEBUG) {
+			if (match.getDocID() != null)
+			    log.trace("I've got a match in {} of {}",
+				      match.getDocID(), count);
+			else
+			    log.trace("I've got a match in {} of {}",
+				      match.getUID(), count);
+		    };
 
 		    atomicMatches.add(match);
 		};
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/MatchModifyClassSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/MatchModifyClassSpans.java
index d6a6318..eb3ed27 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/MatchModifyClassSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/MatchModifyClassSpans.java
@@ -37,7 +37,7 @@
     private final Logger log = LoggerFactory.getLogger(MatchModifyClassSpans.class);
 
     // This advices the java compiler to ignore all loggings
-    public static final boolean DEBUG = true;
+    public static final boolean DEBUG = false;
 
     private int start = -1, end;
     private int tempStart = 0, tempEnd = 0;
@@ -111,30 +111,47 @@
 
 		    // Todo: Implement Divide
 		    // Found class payload of structure <i>start<i>end<b>class
-		    if (payload.length == 9 && bb.get() == this.number) {
-			bb.rewind();
-			tempStart = bb.getInt();
-			tempEnd   = bb.getInt();
+		    if (payload.length == 9) {
 
-			if (DEBUG)
-			    log.trace("Found matching class {}-{}", tempStart, tempEnd);
+			// and classes are matches!
+			if (bb.get() == this.number) {
+			    bb.rewind();
+			    tempStart = bb.getInt();
+			    tempEnd   = bb.getInt();
 
-			// Set start position 
-			if (start == -1)
-			    start = tempStart;
-			else if (tempStart < start)
-			    start = tempStart;
+			    if (DEBUG)
+				log.trace("Found matching class {}-{}", tempStart, tempEnd);
 
-			// Set end position
-			if (tempEnd > end)
-			    end = tempEnd;
+			    // Set start position 
+			    if (start == -1)
+				start = tempStart;
+			    else if (tempStart < start)
+				start = tempStart;
+			    
+			    // Set end position
+			    if (tempEnd > end)
+				end = tempEnd;
+			}
+
+			// Definately keep class information
+			else {
+			    wrappedPayload.add(payload);
+			};
 		    }
 
-		    // No class payload - but keep!
+		    // No class payload
 		    else {
-			if (DEBUG)
-			    log.trace("Remember old payload {}", payload);
-			wrappedPayload.add(payload);
+
+			// Keep as we won't shrink
+			if (start == -1) {
+			    if (DEBUG)
+				log.trace("Remember old payload {}", payload);
+			    wrappedPayload.add(payload);
+			}
+			else if (DEBUG) {
+			    if (DEBUG)
+				log.trace("Ignore old payload {}", payload);
+			};
 		    };
 		};
 	    };
@@ -151,6 +168,16 @@
 		    end
 		);
 
+	    // Only keep class information
+	    // This may change later on ...
+	    for (int i = wrappedPayload.size() - 1; i >= 0; i--) {
+		if (wrappedPayload.get(i).length != 9) {
+		    if (DEBUG)
+			log.trace("Forget old payload {}", wrappedPayload.get(i));
+		    wrappedPayload.remove(i);
+		};
+	    };
+
 	    return true;
 	};
 
diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties
index 2ed007e..98b2947 100644
--- a/src/main/resources/log4j.properties
+++ b/src/main/resources/log4j.properties
@@ -12,6 +12,7 @@
 #log4j.logger.de.ids_mannheim.korap.query.spans.NextSpans = TRACE, stdout
 #log4j.logger.de.ids_mannheim.korap.query.spans.SimpleSpans = TRACE, stdout
 #log4j.logger.de.ids_mannheim.korap.query.spans.ClassSpans = TRACE, stdout
+#log4j.logger.de.ids_mannheim.korap.query.spans.MatchModifyClassSpans = TRACE, stdout
 #log4j.logger.de.ids_mannheim.korap.query.spans.MatchSpans = TRACE, stdout
 
 # Wrapper
diff --git a/src/test/java/de/ids_mannheim/korap/search/TestKorapSearch.java b/src/test/java/de/ids_mannheim/korap/search/TestKorapSearch.java
index 8180a23..b2606bc 100644
--- a/src/test/java/de/ids_mannheim/korap/search/TestKorapSearch.java
+++ b/src/test/java/de/ids_mannheim/korap/search/TestKorapSearch.java
@@ -621,24 +621,53 @@
 
 	KorapQuery kq = new KorapQuery("tokens");
 
-	// Check with 129
 	KorapSearch ks = new KorapSearch(
 	    kq.shrink(1,kq.contains(kq.tag("base/s:s"), kq._(1, kq.seg("s:Leben"))))
 	);
 
 	KorapResult kr = ks.run(ki);
-	System.err.println(kr.getMatch(0).getSnippetBrackets());
+	assertEquals(
+            kr.getQuery(),
+	    "shrink(1: spanContain(<tokens:base/s:s />, {1: tokens:s:Leben}))"
+        );
+	assertEquals(
+            kr.getMatch(0).getSnippetBrackets(),
+            "... Initiative\" eine neue politische Gruppierung ins " +
+	    "[Leben] gerufen hatten. Pressemeldungen zufolge haben sich ..."
+        );
 
-	/*
-
-	ks = new KorapSearch(json);
+	// Try with high class
+	ks = new KorapSearch(
+	    kq.shrink(129, kq.contains(kq.tag("base/s:s"), kq._(129, kq.seg("s:Leben"))))
+	);
 
 	kr = ks.run(ki);
-	System.err.println(kr.toJSON());
-	assertEquals(276, kr.getTotalResults());
+	assertEquals(
+            kr.getQuery(),
+	    "shrink(129: spanContain(<tokens:base/s:s />, {129: tokens:s:Leben}))"
+        );
+	assertEquals(
+            kr.getMatch(0).getSnippetBrackets(),
+            "... Initiative\" eine neue politische Gruppierung ins " +
+	    "[Leben] gerufen hatten. Pressemeldungen zufolge haben sich ..."
+        );
+
+	ks = new KorapSearch(json);
+	kr = ks.run(ki);
+	assertEquals(
+            kr.getQuery(),
+	    "shrink(129: spanElementDistance({129: tokens:s:Namen}, " +
+	    "{129: tokens:s:Leben}, [(base/s:s[0:1], notOrdered, notExcluded)]))"
+        );
+	assertEquals(
+	    kr.getMatch(0).getSnippetBrackets(),
+	    "... ihren Austritt erklärt und unter dem [Namen \"Einheitsbewegung " +
+	    "der sozialistischen Initiative\" eine neue politische Gruppierung " +
+	    "ins Leben] gerufen hatten. Pressemeldungen zufolge haben sich ..."
+        );
+
+	assertEquals(1, kr.getTotalResults());
 	assertEquals(0, kr.getStartIndex());
-	assertEquals(10, kr.getItemsPerPage());
-	*/
     };
 
     @Test
