Index: branches/pap_mops/ppMops/src/ppMops.c
===================================================================
--- branches/pap_mops/ppMops/src/ppMops.c	(revision 25162)
+++ branches/pap_mops/ppMops/src/ppMops.c	(revision 25183)
@@ -17,4 +17,23 @@
         exit(PS_EXIT_SYS_ERROR);
     }
+
+    ppMopsDetections *merged = ppMopsMerge(detections); // Merged detections
+    psFree(detections);
+    if (!merged) {
+        psErrorStackPrint(stderr, "Unable to merge detections");
+        exit(PS_EXIT_SYS_ERROR);
+    }
+
+    if (!ppMopsWrite(merged, args)) {
+        psErrorStackPrint(stderr, "Unable to write detections");
+        exit(PS_EXIT_SYS_ERROR);
+    }
+
+    psFree(merged);
+    psFree(args);
+
+    return PS_EXIT_SUCCESS;
+}
+
 
 #if 0
@@ -210,4 +229,2 @@
 #endif
 
-    return PS_EXIT_SUCCESS;
-}
