diff --git a/biopet.wdl b/biopet.wdl
index 6c9f68cbad9043ad07c249b86d54ecd681707906..93dab22236fd00f9343d353c9048d1c1c6e21706 100644
--- a/biopet.wdl
+++ b/biopet.wdl
@@ -60,7 +60,6 @@ task SampleConfig {
     String? preCommand
     String tool_jar
     Array[File]+ inputFiles
-    String stdoutFile
     String? sample
     String? library
     String? readgroup
@@ -81,12 +80,11 @@ task SampleConfig {
         ${"--library " + library} \
         ${"--readgroup " + readgroup} \
         ${"--jsonOutput " + jsonOutputPath} \
-        ${"--tsvOutput " + tsvOutputPath} \
-        > ${stdoutFile}
+        ${"--tsvOutput " + tsvOutputPath}
     }
 
     output {
-        File keysFile = stdoutFile
+        File keysFile = stdout()
         File? jsonOutput = jsonOutputPath
         File? tsvOutput = tsvOutputPath
     }
diff --git a/gatk.wdl b/gatk.wdl
index 56e2bd4011468223c61713ad161374b269b36861..bd97b427db13da28d323c0408a58f79f0ca0f275 100644
--- a/gatk.wdl
+++ b/gatk.wdl
@@ -278,7 +278,7 @@ task SplitNCigarReads {
 
     output {
         File bam = output_bam
-        File bam_index = sub(output_bam, ".bam$", ".bai")
+        File bam_index = sub(output_bam, "\\.bam$", ".bai")
     }
 
     runtime {