diff --git a/CHANGELOG.md b/CHANGELOG.md
index a34b0ec0383b62cdfd8cb818a6e6db528768ca3b..8e102e29d19b82b198f45516ae8b781f62086a4b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,10 @@ version 2.2.0-dev
 ---------------------------
 + Update biowdl-input-converter in common.wdl to version 0.2.1.
 + Update TALON section to now include the new annotation file output, and add config file creation to the TALON task.
++ Removed unused inputs (trimPrimer and format) for cutadapt.
++ Various minor command tweaks to increase stability.
++ Fixed unused inputs in bedtools sort (inputs are now used).
++ Added miniwdl check to linting.
 + Update TALON default image to version 4.4.1.
 
 version 2.1.0
diff --git a/CPAT.wdl b/CPAT.wdl
index 53aeac94a84f05cdd2fd2d211c5fca4e96b62154..f9a77bed2c452ecd5aab2a680e8264699c140955 100644
--- a/CPAT.wdl
+++ b/CPAT.wdl
@@ -18,7 +18,7 @@ task CPAT {
     # select_first is needed in order to convert the optional arrays to non-optionals.
     command {
         set -e
-        mkdir -p $(dirname ~{outFilePath})
+        mkdir -p "$(dirname ~{outFilePath})"
         cpat.py \
         --gene ~{gene} \
         --outfile ~{outFilePath} \
diff --git a/bedtools.wdl b/bedtools.wdl
index f9859f93516503e4b4486a3e7ebab1129d42d943..f6748f3189589fb032ff662dad5da392e0287d97 100644
--- a/bedtools.wdl
+++ b/bedtools.wdl
@@ -27,6 +27,7 @@ task Sort {
         Boolean sizeD = false
         Boolean chrThenSizeA = false
         Boolean chrThenSizeD = false
+        Boolean chrThenScoreA = false
         Boolean chrThenScoreD = false
         File? g
         File? faidx
@@ -36,11 +37,14 @@ task Sort {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputBed})
+        mkdir -p "$(dirname ~{outputBed})"
         bedtools sort \
         -i ~{inputBed} \
         ~{true="-sizeA" false="" sizeA} \
         ~{true="-sizeD" false="" sizeD} \
+        ~{true="-chrThenSizeA" false="" chrThenSizeA} \
+        ~{true="-chrThenSizeD" false="" chrThenSizeD} \
+        ~{true="-chrThenScoreA" false="" chrThenScoreA} \
         ~{true="-chrThenScoreD" false="" chrThenScoreD} \
         ~{"-g " + g} \
         ~{"-faidx" + faidx} \
diff --git a/biowdl.wdl b/biowdl.wdl
index e524ac6e5473a0f30219e30104d543cca6ecee99..32fd5a735d254f4f1d7bd27b5d676429976a465b 100644
--- a/biowdl.wdl
+++ b/biowdl.wdl
@@ -36,7 +36,7 @@ task InputConverter {
 
     command <<<
         set -e
-        mkdir -p $(dirname ~{outputFile})
+        mkdir -p "$(dirname ~{outputFile})"
         biowdl-input-converter \
         -o ~{outputFile} \
         ~{true="--skip-file-check" false="" skipFileCheck} \
diff --git a/bowtie.wdl b/bowtie.wdl
index 51d18be7566880139cb34562dc0c9a06b4b2e32e..72a396412d5f6edb9546adf1b946067be5031667 100644
--- a/bowtie.wdl
+++ b/bowtie.wdl
@@ -49,7 +49,7 @@ task Bowtie {
 
     command {
         set -e -o pipefail
-        mkdir -p $(dirname ~{outputPath})
+        mkdir -p "$(dirname ~{outputPath})"
         bowtie -q \
         --sam \
         ~{"--seedmms " +  seedmms} \
diff --git a/bwa.wdl b/bwa.wdl
index 6623899134615340dffd9d2def09e3e4379c9b88..05c8716af2ea03b1ca1e1127f1df3ed48104e02a 100644
--- a/bwa.wdl
+++ b/bwa.wdl
@@ -18,7 +18,7 @@ task Mem {
 
     command {
         set -e -o pipefail
-        mkdir -p $(dirname ~{outputPath})
+        mkdir -p "$(dirname ~{outputPath})"
         bwa mem \
         ~{"-t " + threads} \
         ~{"-R '" + readgroup}~{true="'" false="" defined(readgroup)} \
diff --git a/collect-columns.wdl b/collect-columns.wdl
index 263e317dc4c36b413ad5643c77c49ec17926e7e5..d453e5bed4ae2a9389875f31c0dba1468d64c432 100644
--- a/collect-columns.wdl
+++ b/collect-columns.wdl
@@ -18,7 +18,7 @@ task CollectColumns {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputPath})
+        mkdir -p "$(dirname ~{outputPath})"
         collect-columns \
         ~{outputPath} \
         ~{sep=" " inputTables} \
diff --git a/common.wdl b/common.wdl
index 21227e4f2d92340d152a44fdcae339f9a51a333f..f8b2cd8b9dc6aa180c4624927c651fbfea74c851 100644
--- a/common.wdl
+++ b/common.wdl
@@ -57,7 +57,7 @@ task ConcatenateTextFiles {
 
     command {
         set -e -o pipefail
-        mkdir -p $(dirname ~{combinedFilePath})
+        mkdir -p "$(dirname ~{combinedFilePath})"
         ~{cmdPrefix} ~{sep=" " fileList} ~{cmdSuffix} > ~{combinedFilePath}
     }
 
@@ -82,7 +82,7 @@ task Copy {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputPath})
+        mkdir -p "$(dirname ~{outputPath})"
         cp ~{true="-r" false="" recursive} ~{inputFile} ~{outputPath}
     }
 
@@ -121,7 +121,8 @@ task MapMd5 {
     }
 
     command {
-        cat ~{write_map(map)} | md5sum - | sed -e 's/  -//'
+        set -e -o pipefail
+        md5sum "~{write_map(map)}" | cut -f 1 -d ' '
     }
 
     output {
@@ -166,7 +167,7 @@ task YamlToJson {
     }
     command {
         set -e
-        mkdir -p $(dirname ~{outputJson})
+        mkdir -p "$(dirname ~{outputJson})"
         python <<CODE
         import json
         import yaml
diff --git a/cutadapt.wdl b/cutadapt.wdl
index 571bc884a23a3691006dbdc1e9ad6029c24d4a8b..58b10d73ae9aad19cf4c51a8c566bed95c9969c1 100644
--- a/cutadapt.wdl
+++ b/cutadapt.wdl
@@ -6,7 +6,6 @@ task Cutadapt {
         File? read2
         String read1output = "cut_r1.fq.gz"
         String? read2output
-        String? format
         Array[String] adapter = []
         Array[String] front = []
         Array[String] anywhere = []
@@ -49,7 +48,6 @@ task Cutadapt {
         String? untrimmedPairedOutputPath
         Boolean? colorspace
         Boolean? doubleEncode
-        Boolean? trimPrimer
         Boolean? stripF3
         Boolean? maq
         Boolean? bwa
@@ -169,10 +167,6 @@ task Cutadapt {
             description: "The name of the resulting second end fastq file.",
             category: "common"
         }
-        format: {
-            description: "Equivalent to cutadapt's --format option.",
-            category: "advanced"
-        }
         adapter: {
             description: "A list of 3' ligated adapter sequences to be cut from the given first or single end fastq file.",
             category: "common"
@@ -341,10 +335,6 @@ task Cutadapt {
             description: "Equivalent to cutadapt's --double-encode flag.",
             category: "advanced"
         }
-        trimPrimer: {
-            description: "Equivalent to cutadapt's --trim-primer flag.",
-            category: "advanced"
-        }
         stripF3: {
             description: "Equivalent to cutadapt's --strip-f3 flag.",
             category: "advanced"
diff --git a/fastqc.wdl b/fastqc.wdl
index 931c153a68c374bc2d0f9f51187c09cd2f5936cf..1e835c4e9ac382b96ca1b6b5d9ce1cbce1e24dbd 100644
--- a/fastqc.wdl
+++ b/fastqc.wdl
@@ -145,7 +145,9 @@ task GetConfiguration {
 
     command <<<
         set -e
-        fastqcDir=$(dirname $(readlink -f $(which fastqc)))
+        fastqcExe="$(command -v fastqc)"
+        fastqcPath="$(readlink -f $fastqcExe)"
+        fastqcDir="$(dirname $fastqcPath)"
         mkdir Configuration
         cp ${fastqcDir}/Configuration/adapter_list.txt Configuration/adapter_list.txt
         cp ${fastqcDir}/Configuration/contaminant_list.txt Configuration/contaminant_list.txt
diff --git a/fastqsplitter.wdl b/fastqsplitter.wdl
index 25c565526418879ed64189790ffc358c0dd754f3..c523cf8a7dd4e86e65cc768daa3c98f98854b39f 100644
--- a/fastqsplitter.wdl
+++ b/fastqsplitter.wdl
@@ -38,7 +38,7 @@ task Fastqsplitter {
     command <<<
         set -e
         for FILE in ~{sep=' ' outputPaths}
-            do mkdir -p $(dirname $FILE)
+            do mkdir -p "$(dirname $FILE)"
         done
         fastqsplitter \
         ~{"-c " + compressionLevel} \
diff --git a/gatk.wdl b/gatk.wdl
index ce8d4c46c8a66f9c3d7ea5d94dc2bbd4246fa38c..a48cb8b05e3184b376e6b81e20f40658fd2ab15f 100644
--- a/gatk.wdl
+++ b/gatk.wdl
@@ -19,7 +19,7 @@ task ApplyBQSR {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputBamPath})
+        mkdir -p "$(dirname ~{outputBamPath})"
         gatk --java-options -Xmx~{javaXmx} \
         ApplyBQSR \
         --create-output-bam-md5 \
@@ -69,7 +69,7 @@ task BaseRecalibrator {
 
     command {
         set -e
-        mkdir -p $(dirname ~{recalibrationReportPath})
+        mkdir -p "$(dirname ~{recalibrationReportPath})"
         gatk --java-options -Xmx~{javaXmx} \
         BaseRecalibrator \
         -R ~{referenceFasta} \
@@ -108,7 +108,7 @@ task CombineGVCFs {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputPath})
+        mkdir -p "$(dirname ~{outputPath})"
         gatk --java-options -Xmx~{javaXmx} \
         CombineGVCFs \
         -R ~{referenceFasta} \
@@ -141,7 +141,7 @@ task GatherBqsrReports {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputReportPath})
+        mkdir -p "$(dirname ~{outputReportPath})"
         gatk --java-options -Xmx~{javaXmx} \
         GatherBQSRReports \
         -I ~{sep=' -I ' inputBQSRreports} \
@@ -177,7 +177,7 @@ task GenotypeGVCFs {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputPath})
+        mkdir -p "$(dirname ~{outputPath})"
         gatk --java-options -Xmx~{javaXmx} \
         GenotypeGVCFs \
         -R ~{referenceFasta} \
@@ -223,7 +223,7 @@ task HaplotypeCallerGvcf {
 
     command {
         set -e
-        mkdir -p $(dirname ~{gvcfPath})
+        mkdir -p "$(dirname ~{gvcfPath})"
         gatk --java-options -Xmx~{javaXmx} \
         HaplotypeCaller \
         -R ~{referenceFasta} \
@@ -271,7 +271,7 @@ task MuTect2 {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputVcf})
+        mkdir -p "$(dirname ~{outputVcf})"
         gatk --java-options -Xmx~{javaXmx} \
         Mutect2 \
         -R ~{referenceFasta} \
@@ -440,7 +440,7 @@ task FilterMutectCalls {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputVcf})
+        mkdir -p "$(dirname ~{outputVcf})"
         gatk --java-options -Xmx~{javaXmx} \
         FilterMutectCalls \
         -R ~{referenceFasta} \
@@ -485,7 +485,7 @@ task SplitNCigarReads {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputBam})
+        mkdir -p "$(dirname ~{outputBam})"
         gatk --java-options -Xmx~{javaXmx} \
         SplitNCigarReads \
         -I ~{inputBam} \
@@ -526,20 +526,19 @@ task CombineVariants {
 
     command <<<
         set -e
-        mkdir -p $(dirname "~{outputPath}")
+        mkdir -p "$(dirname ~{outputPath})"
 
         # build "-V:<ID> <file.vcf>" arguments according to IDs and VCFs to merge
         # Make sure commands are run in bash
-        bash -c '#!/usr/bin/env bash
-        set -eux
+        V_args=$(bash -c '
+        set -eu
         ids=(~{sep=" " identifiers})
         vars=(~{sep=" " variantVcfs})
-        V_args=$(
-            for (( i = 0; i < ${#ids[@]}; ++i ))
-              do
-                printf -- "-V:%s %s " "${ids[i]}" "${vars[i]}"
-              done
-        )
+        for (( i = 0; i < ${#ids[@]}; ++i ))
+          do
+            printf -- "-V:%s %s " "${ids[i]}" "${vars[i]}"
+          done
+        ')
         java -Xmx~{javaXmx} -jar ~{installDir}/GenomeAnalysisTK.jar \
         -T CombineVariants \
         -R ~{referenceFasta} \
@@ -547,7 +546,6 @@ task CombineVariants {
         --filteredrecordsmergetype ~{filteredRecordsMergeType} \
         --out ~{outputPath} \
         $V_args
-        '
     >>>
 
     output {
diff --git a/gffcompare.wdl b/gffcompare.wdl
index 9f5f1af5d13df54373cf99c3d4f5f478d913266b..b60881fafa084028b2963b4b210a896e105f2517 100644
--- a/gffcompare.wdl
+++ b/gffcompare.wdl
@@ -31,8 +31,8 @@ task GffCompare {
         File? noneFile # This is a wdl workaround. Please do not assign!
     }
     # This allows for the creation of output directories
-    String dirPrefix= if defined(outputDir)
-        then outputDir + "/"
+    String dirPrefix = if defined(outputDir)
+        then select_first([outputDir]) + "/"
         else ""
     String totalPrefix = dirPrefix + outPrefix
 
diff --git a/hisat2.wdl b/hisat2.wdl
index e40f361630fa4e10064a043193b51607db62e1d6..3423e56b02f6ba4f475dc7c02262b7654d7ce55a 100644
--- a/hisat2.wdl
+++ b/hisat2.wdl
@@ -24,7 +24,7 @@ task Hisat2 {
 
     command {
         set -e -o pipefail
-        mkdir -p $(dirname ~{outputBam})
+        mkdir -p "$(dirname ~{outputBam})"
         hisat2 \
         -p ~{threads} \
         -x ~{sub(indexFiles[0], "\.[0-9]\.ht2", "")} \
diff --git a/htseq.wdl b/htseq.wdl
index 645396e8061179df2d119d61baef6cac35af1b59..3afe51a46c838d818f632270f9932f7a2ab71d32 100644
--- a/htseq.wdl
+++ b/htseq.wdl
@@ -18,7 +18,7 @@ task HTSeqCount {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputTable})
+        mkdir -p "$(dirname ~{outputTable})"
         htseq-count \
         -f ~{format} \
         -r ~{order} \
diff --git a/minimap2.wdl b/minimap2.wdl
index c29f3314124d5120dcf2587967415d0fad576194..d8a454daab3a5f879378bedf6c2c9e896cd75468 100644
--- a/minimap2.wdl
+++ b/minimap2.wdl
@@ -37,7 +37,7 @@ task Indexing {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputPrefix})
+        mkdir -p "$(dirname ~{outputPrefix})"
         minimap2 \
         ~{true="-H" false="" useHomopolymerCompressedKmer} \
         ~{"-k " + kmerSize} \
@@ -116,7 +116,7 @@ task Mapping {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputPrefix})
+        mkdir -p "$(dirname ~{outputPrefix})"
         minimap2 \
         ~{"-x " + presetOption} \
         ~{"-k " + kmerSize} \
diff --git a/picard.wdl b/picard.wdl
index 12e8d880d177abedba412b5be38bfa7ef9ee4035..caee009b044783696b3d20a62bc6f0562cd3d8c3 100644
--- a/picard.wdl
+++ b/picard.wdl
@@ -13,7 +13,7 @@ task BedToIntervalList {
 
     command {
         set -e
-        mkdir -p $(dirname "~{outputPath}")
+        mkdir -p "$(dirname ~{outputPath})"
         picard -Xmx~{javaXmx} \
         BedToIntervalList \
         I=~{bedFile} \
@@ -58,7 +58,7 @@ task CollectMultipleMetrics {
 
     command {
         set -e
-        mkdir -p $(dirname "~{basename}")
+        mkdir -p "$(dirname ~{basename})"
         picard -Xmx~{javaXmx} \
         CollectMultipleMetrics \
         I=~{inputBam} \
@@ -140,7 +140,7 @@ task CollectRnaSeqMetrics {
 
     command {
         set -e
-        mkdir -p $(dirname "~{basename}")
+        mkdir -p "$(dirname ~{basename})"
         picard -Xmx~{javaXmx} \
         CollectRnaSeqMetrics \
         I=~{inputBam} \
@@ -179,7 +179,7 @@ task CollectTargetedPcrMetrics {
 
     command {
         set -e
-        mkdir -p $(dirname "~{basename}")
+        mkdir -p "$(dirname ~{basename})"
         picard -Xmx~{javaXmx} \
         CollectTargetedPcrMetrics \
         I=~{inputBam} \
@@ -217,7 +217,7 @@ task GatherBamFiles {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputBamPath})
+        mkdir -p "$(dirname ~{outputBamPath})"
         picard -Xmx~{javaXmx} \
         GatherBamFiles \
         INPUT=~{sep=' INPUT=' inputBams} \
@@ -251,7 +251,7 @@ task GatherVcfs {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputVcfPath})
+        mkdir -p "$(dirname ~{outputVcfPath})"
         picard -Xmx~{javaXmx} \
         GatherVcfs \
         INPUT=~{sep=' INPUT=' inputVcfs} \
@@ -294,7 +294,7 @@ task MarkDuplicates {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputBamPath})
+        mkdir -p "$(dirname ~{outputBamPath})"
         picard -Xmx~{javaXmx} \
         MarkDuplicates \
         INPUT=~{sep=' INPUT=' inputBams} \
@@ -339,7 +339,7 @@ task MergeVCFs {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputVcfPath})
+        mkdir -p "$(dirname ~{outputVcfPath})"
         picard -Xmx~{javaXmx} \
         MergeVcfs \
         INPUT=~{sep=' INPUT=' inputVCFs} \
@@ -443,7 +443,7 @@ task SortVcf {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputVcfPath})
+        mkdir -p "$(dirname ~{outputVcfPath})"
         picard -Xmx~{javaXmx} \
         SortVcf \
         I=~{sep=" I=" vcfFiles} \
diff --git a/requirements-test.txt b/requirements-test.txt
index 438f683fe9697872f30e5bdfb1b628ec1e9939e6..f074413b3107f991dfded0ec192012527a18bbc4 100644
--- a/requirements-test.txt
+++ b/requirements-test.txt
@@ -1 +1,2 @@
-cromwell
\ No newline at end of file
+cromwell
+miniwdl
\ No newline at end of file
diff --git a/samtools.wdl b/samtools.wdl
index 871110d2e3119422a4269e3bebd18afcd2bf1e7d..492cfaf432075af69f7e53340d8333c19273ebb3 100644
--- a/samtools.wdl
+++ b/samtools.wdl
@@ -13,7 +13,7 @@ task BgzipAndIndex {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputGz})
+        mkdir -p "$(dirname ~{outputGz})"
         bgzip -c ~{inputFile} > ~{outputGz}
         tabix ~{outputGz} -p ~{type}
     }
@@ -45,7 +45,7 @@ task Index {
         # Make sure outputBamPath does not exist.
         if [ ! -f ~{outputPath} ]
         then
-            mkdir -p $(dirname ~{outputPath})
+            mkdir -p "$(dirname ~{outputPath})"
             ln ~{bamFile} ~{outputPath}
         fi
         samtools index ~{outputPath} ~{bamIndexPath}
@@ -74,7 +74,7 @@ task Merge {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputBamPath})
+        mkdir -p "$(dirname ~{outputBamPath})"
         samtools merge ~{true="-f" false="" force} ~{outputBamPath} ~{sep=' ' bamFiles}
         samtools index ~{outputBamPath} ~{indexPath}
     }
@@ -99,7 +99,7 @@ task SortByName {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputBamPath})
+        mkdir -p "$(dirname ~{outputBamPath})"
         samtools sort -n ~{bamFile} -o ~{outputBamPath}
     }
 
@@ -122,7 +122,7 @@ task Markdup {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputBamPath})
+        mkdir -p "$(dirname ~{outputBamPath})"
         samtools markdup ~{inputBam} ~{outputBamPath}
     }
 
@@ -145,7 +145,7 @@ task Flagstat {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputPath})
+        mkdir -p "$(dirname ~{outputPath})"
         samtools flagstat ~{inputBam} > ~{outputPath}
     }
 
@@ -224,7 +224,7 @@ task Tabix {
     # FIXME: It is better to do the indexing on VCF creation. Not in a separate task. With file localization this gets hairy fast.
     command {
         set -e
-        mkdir -p $(dirname ~{outputFilePath})
+        mkdir -p "$(dirname ~{outputFilePath})"
         if [ ! -f ~{outputFilePath} ]
         then
             ln ~{inputFile} ~{outputFilePath}
@@ -262,7 +262,7 @@ task View {
     # Always output to bam and output header
     command {
         set -e
-        mkdir -p $(dirname ~{outputFileName})
+        mkdir -p "$(dirname ~{outputFileName})"
         samtools view -b \
         ~{"-T " + referenceFasta} \
         ~{"-o " + outputFileName} \
diff --git a/seqtk.wdl b/seqtk.wdl
index 662d7e29321372161308eccbe430680315ee7445..0b1419d613295b3d72a1ed6421a6a6a8b981c1a5 100644
--- a/seqtk.wdl
+++ b/seqtk.wdl
@@ -13,7 +13,7 @@ task Sample {
 
     command {
         set -e -o pipefail
-        mkdir -p $(dirname outFilePath)
+        mkdir -p "$(dirname ~{outFilePath})"
         ~{preCommand}
         seqtk sample \
         ~{"-s " + seed} \
diff --git a/star.wdl b/star.wdl
index 3ff6cf558aeec36d54837affffd5ec22698e5610..fb788175af154fdc0af84018b9e3de840e2a622c 100644
--- a/star.wdl
+++ b/star.wdl
@@ -24,7 +24,7 @@ task Star {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outFileNamePrefix})
+        mkdir -p "$(dirname ~{outFileNamePrefix})"
         STAR \
         --readFilesIn ~{sep=',' inputR1} ~{sep="," inputR2} \
         --outFileNamePrefix ~{outFileNamePrefix} \
diff --git a/stringtie.wdl b/stringtie.wdl
index 3392d7b21da26942f25fc93fc34327d95575d7ce..2dcaa9a1c8c8de75eaab9062109e56e3679a0f21 100644
--- a/stringtie.wdl
+++ b/stringtie.wdl
@@ -18,7 +18,7 @@ task Stringtie {
 
     command {
         set -e
-        mkdir -p $(dirname ~{assembledTranscriptsFile})
+        mkdir -p "$(dirname ~{assembledTranscriptsFile})"
         stringtie \
         ~{"-p " + threads} \
         ~{"-G " + referenceGtf} \
@@ -108,7 +108,7 @@ task Merge {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputGtfPath})
+        mkdir -p "$(dirname ~{outputGtfPath})"
         stringtie --merge \
         -o ~{outputGtfPath} \
         ~{"-G " + guideGtf} \
diff --git a/talon.wdl b/talon.wdl
index 408c787f1fcf73d546b90d0e09478000f2e7c415..455f38fd403feebc4b37a92227956f7eae7d81e9 100644
--- a/talon.wdl
+++ b/talon.wdl
@@ -37,7 +37,7 @@ task CreateAbundanceFileFromDatabase {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputPrefix})
+        mkdir -p "$(dirname ~{outputPrefix})"
         talon_abundance \
         ~{"--db=" + databaseFile} \
         ~{"-a " + annotationVersion} \
@@ -107,7 +107,7 @@ task CreateGtfFromDatabase {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputPrefix})
+        mkdir -p "$(dirname ~{outputPrefix})"
         talon_create_GTF \
         ~{"--db=" + databaseFile} \
         ~{"-b " + genomeBuild} \
@@ -179,7 +179,7 @@ task FilterTalonTranscripts {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputPrefix})
+        mkdir -p "$(dirname ~{outputPrefix})"
         talon_filter_transcripts \
         ~{"--db=" + databaseFile} \
         ~{"-a " + annotationVersion} \
@@ -232,7 +232,7 @@ task GetReadAnnotations {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputPrefix})
+        mkdir -p "$(dirname ~{outputPrefix})"
         talon_fetch_reads \
         ~{"--db " + databaseFile} \
         ~{"--build " + genomeBuild} \
@@ -292,7 +292,7 @@ task InitializeTalonDatabase {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputPrefix})
+        mkdir -p "$(dirname ~{outputPrefix})"
         talon_initialize_database \
         ~{"--f=" + GTFfile} \
         ~{"--g=" + genomeBuild} \
@@ -402,7 +402,7 @@ task SummarizeDatasets {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputPrefix})
+        mkdir -p "$(dirname ~{outputPrefix})"
         talon_summarize \
         ~{"--db " + databaseFile} \
         ~{true="--verbose" false="" setVerbose} \
@@ -462,7 +462,7 @@ task Talon {
 
     command <<<
         set -e
-        mkdir -p $(dirname ~{outputPrefix})
+        mkdir -p "$(dirname ~{outputPrefix})"
         export TMPDIR=/tmp
         for file in ~{sep=" " SAMfiles}
         do
diff --git a/transcriptclean.wdl b/transcriptclean.wdl
index df187fd2a2a7313d1f718895e399de4762e0a1cc..b7b913dcf310de9980e61fb445b41d1ec9987b3e 100644
--- a/transcriptclean.wdl
+++ b/transcriptclean.wdl
@@ -34,7 +34,7 @@ task GetSJsFromGtf {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputPrefix})
+        mkdir -p "$(dirname ~{outputPrefix})"
         get_SJs_from_gtf \
         ~{"--f=" + GTFfile} \
         ~{"--g=" + genomeFile} \
@@ -88,7 +88,7 @@ task GetTranscriptCleanStats {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputPrefix})
+        mkdir -p "$(dirname ~{outputPrefix})"
         get_TranscriptClean_stats \
         ~{transcriptCleanSAMfile} \
         ~{outputPrefix}
@@ -146,7 +146,7 @@ task TranscriptClean {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputPrefix})
+        mkdir -p "$(dirname ~{outputPrefix})"
         TranscriptClean \
         ~{"-s " + SAMfile} \
         ~{"-g " + referenceGenome} \
diff --git a/wisestork.wdl b/wisestork.wdl
index 95bfcd0663b3c7ce0104da65ddba742361157f3f..0fd812b1b5644dd589b36839db5d2d1700bf294e 100644
--- a/wisestork.wdl
+++ b/wisestork.wdl
@@ -34,7 +34,7 @@ task Count {
 
     command {
         set -e
-        mkdir -p $(dirname ~{outputBed})
+        mkdir -p "$(dirname ~{outputBed})"
         wisestork count \
         ~{"--binsize " + binSize} \
        --reference ~{reference} \