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();
diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties
index a8b155d..5564f24 100644
--- a/src/main/resources/log4j.properties
+++ b/src/main/resources/log4j.properties
@@ -2,5 +2,6 @@
 #log4j.rootLogger = DEBUG, stdout
 
 log4j.appender.stdout = org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target= System.out
 log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
 log4j.appender.stdout.layout.ConversionPattern = %5p (%F:%L) -> %m%n
\ No newline at end of file