diff --git a/cutadapt.wdl b/cutadapt.wdl
index 8b073442c02a449871f7dc6a320a8eabdf82d8d4..0df1ced44f253b904586c7a89b7dc61436181551 100644
--- a/cutadapt.wdl
+++ b/cutadapt.wdl
@@ -61,10 +61,12 @@ task Cutadapt {
         String? reportPath
     }
 
+    String read2outputArg = if (defined(read2output)) then "mkdir -p $(dirname " + read2output + ")" else ""
+
     command {
         set -e -o pipefail
         ~{"mkdir -p $(dirname " + read1output + ")"}
-        ~{"mkdir -p $(dirname " + read2output + ")"}
+        ~{read2outputArg}
         ~{"mkdir -p $(dirname " + reportPath + ")"}
         ~{preCommand}
         cutadapt \
diff --git a/fastqc.wdl b/fastqc.wdl
index 6d924cf550a84640fcf3e8f9e1b555d2cf239dd7..f1d23885f210e73b2452be62b499ca6ab553ed85 100644
--- a/fastqc.wdl
+++ b/fastqc.wdl
@@ -21,10 +21,10 @@ task Fastqc {
     }
 
     # Chops of the .gz extension if present.
-    String name = sub(seqFile, "\\.gz$","")
+    String name = sub(seqFile, "\.gz$","")
     # This regex chops of the extension and replaces it with _fastqc for the reportdir.
     # Just as fastqc does it.
-    String reportDir = outdirPath + "/" + sub(basename(name), "\\.[^\\.]*$", "_fastqc")
+    String reportDir = outdirPath + "/" + sub(basename(name), "\.[^\.]*$", "_fastqc")
 
     command {
         set -e -o pipefail