diff --git a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetCommandLineFunctionTrait.scala b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetCommandLineFunctionTrait.scala
index 498b71c6815d8084ae59107e0bbdee2a6b28429d..905b3a715d3a6a863cefc71d74339f5757281727 100644
--- a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetCommandLineFunctionTrait.scala
+++ b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetCommandLineFunctionTrait.scala
@@ -48,7 +48,8 @@ trait BiopetCommandLineFunctionTrait extends CommandLineFunction with Configurab
   protected[core] def beforeCmd {}
 
   /**
-   * Can override this method. This is executed after the script is done en queue starts to generate the graph
+   * Can overr
+   * ide this method. This is executed after the script is done en queue starts to generate the graph
    */
   protected[core] def afterGraph {}
   //TODO: function need rename to beforeGraph
@@ -123,7 +124,10 @@ trait BiopetCommandLineFunctionTrait extends CommandLineFunction with Configurab
 
     beforeCmd
 
-    addJobReportBinding("cores", if (nCoresRequest.get.toInt > 0) nCoresRequest.get.toInt else 1)
+    addJobReportBinding("cores", nCoresRequest match {
+      case Some(n) if n > 0 => n
+      case _ => 1
+    })
     addJobReportBinding("version", getVersion)
   }
 
@@ -166,6 +170,8 @@ trait BiopetCommandLineFunctionTrait extends CommandLineFunction with Configurab
 
   /** Get version from cache otherwise execute the version command  */
   def getVersion: String = {
+    if (!BiopetCommandLineFunctionTrait.executableCache.contains(executable))
+      checkExecutable
     if (!BiopetCommandLineFunctionTrait.versionCache.contains(executable))
       BiopetCommandLineFunctionTrait.versionCache += executable -> getVersionInternal
     return BiopetCommandLineFunctionTrait.versionCache(executable)
diff --git a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetQScript.scala b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetQScript.scala
index db8a9eb497cb5aad4d54792a0c16cca92c4921ce..8b6b0a6f59d26fe96489d536be3074f606fe6170 100644
--- a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetQScript.scala
+++ b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetQScript.scala
@@ -73,12 +73,14 @@ trait BiopetQScript extends Configurable with GatkLogging {
       case f: BiopetCommandLineFunctionTrait => {
         f.checkExecutable
         f.afterGraph
+        f.commandLine
       }
       case _ =>
     }
 
-    if (outputDir.canWrite) globalConfig.writeReport(qSettings.runName, outputDir + ".log/" + qSettings.runName)
-    else BiopetQScript.addError("Output dir: '" + outputDir + "' is not writeable")
+    if (outputDir.getParentFile.canWrite || (outputDir.exists && outputDir.canWrite))
+      globalConfig.writeReport(qSettings.runName, new File(outputDir, ".log/" + qSettings.runName))
+    else BiopetQScript.addError("Parent of output dir: '" + outputDir.getParent + "' is not writeable, outputdir can not be created")
 
     BiopetQScript.checkErrors
   }
diff --git a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/config/Config.scala b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/config/Config.scala
index e25e8ef508188adbd5f767b20ca1f688c4eed922..faae1634ab4f226d98a297cf22122dd106983811 100644
--- a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/config/Config.scala
+++ b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/config/Config.scala
@@ -140,7 +140,8 @@ class Config(var map: Map[String, Any]) extends Logging {
     } else ConfigValue(requestedIndex, null, null, freeVar)
   }
 
-  def writeReport(id: String, directory: String): Unit = {
+  def writeReport(id: String, directory: File): Unit = {
+    directory.mkdirs()
 
     def convertIndexValuesToMap(input: List[(ConfigValueIndex, Any)], forceFreeVar: Option[Boolean] = None): Map[String, Any] = {
       input.foldLeft(Map[String, Any]())(
@@ -155,8 +156,7 @@ class Config(var map: Map[String, Any]) extends Logging {
     }
 
     def writeMapToJsonFile(map: Map[String, Any], name: String): Unit = {
-      val file = new File(directory + "/" + id + "." + name + ".json")
-      file.getParentFile.mkdirs()
+      val file = new File(directory, id + "." + name + ".json")
       val writer = new PrintWriter(file)
       writer.write(ConfigUtils.mapToJson(map).spaces2)
       writer.close()