diff --git a/src/PHPCoverFish/CoverFishScanCommand.php b/src/PHPCoverFish/CoverFishScanCommand.php
index <HASH>..<HASH> 100644
--- a/src/PHPCoverFish/CoverFishScanCommand.php
+++ b/src/PHPCoverFish/CoverFishScanCommand.php
@@ -196,11 +196,15 @@ class CoverFishScanCommand extends Command
         );
 
         try {
-            $scanner = new CoverFishScanner($cliOptions, $outOptions);
+
+            $scanner = new CoverFishScanner($cliOptions, $outOptions, $output);
             $scanner->analysePHPUnitFiles();
+
         } catch (CoverFishFailExit $e) {
-            die(CoverFishFailExit::RETURN_CODE_SCAN_FAIL);
+            return CoverFishFailExit::RETURN_CODE_SCAN_FAIL;
         }
+
+        return 0;
     }
 
     /**
fix problem in exit code behaviour during scan fails and introduce output interface usage as standard out