Fixed tests.

Change-Id: If5db5dff398a127119e04cf2a84ece21a3127190
diff --git a/src/main/java/de/ids_mannheim/korap/sru/KorapSRUSearchResultSet.java b/src/main/java/de/ids_mannheim/korap/sru/KorapSRUSearchResultSet.java
index c76bf6a..25133f0 100644
--- a/src/main/java/de/ids_mannheim/korap/sru/KorapSRUSearchResultSet.java
+++ b/src/main/java/de/ids_mannheim/korap/sru/KorapSRUSearchResultSet.java
@@ -36,8 +36,8 @@
  */
 public class KorapSRUSearchResultSet extends SRUSearchResultSet {
 
-    private Logger logger = (Logger) LoggerFactory
-            .getLogger(KorapSRUSearchResultSet.class);
+    private Logger logger =
+            LoggerFactory.getLogger(KorapSRUSearchResultSet.class);
 
     private int i = -1;
     private KorapResult korapResult;
@@ -226,20 +226,30 @@
                     continue;
                 }
 
-                // FCS advanced dataview does not allow multiple
-                // annotations on the same segment.
-                // for (Annotation annotation : annotations){
-                Annotation annotation = annotations.get(0);
-
-                if (annotation.getHitLevel() > 0) {
-                    helper.addSpan(annotationLayer.getLayerId(),
-                            annotation.getStart(), annotation.getEnd(),
-                            annotation.getValue(), annotation.getHitLevel());
-                }
-                else {
-                    helper.addSpan(annotationLayer.getLayerId(),
-                            annotation.getStart(), annotation.getEnd(),
-                            annotation.getValue());
+                
+                 for (Annotation annotation : annotations){
+                    try {
+                        if (annotation.getHitLevel() > 0) {
+                            helper.addSpan(annotationLayer.getLayerId(),
+                                    annotation.getStart(), annotation.getEnd(),
+                                    annotation.getValue(), annotation.getHitLevel());
+                        }
+                        else {
+                            helper.addSpan(annotationLayer.getLayerId(),
+                                    annotation.getStart(), annotation.getEnd(),
+                                    annotation.getValue());
+                        }
+                    }
+                    catch (Exception e) {
+                        logger.error(e.getMessage());
+                        continue;
+                    }
+                    
+                    // FCS advanced dataview does not allow multiple
+                    // annotations on the same segment.
+                    if (!annotationLayer.getLayerCode().equals("text")){
+                        break;
+                    }
                 }
             }
             map.clear();