diff --git a/chipathlon/jobs/scripts/download_fastq.py b/chipathlon/jobs/scripts/download_fastq.py
index 9b79b4b7cfb4f230aa339718d5d59d050f796e1b..3bd57cfc800f7aae834beb63d9200e4500a3ae19 100755
--- a/chipathlon/jobs/scripts/download_fastq.py
+++ b/chipathlon/jobs/scripts/download_fastq.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/bin/env python 
 import chipathlon.utils
 import argparse
 
diff --git a/chipathlon/jobs/scripts/sort_wrapper.sh b/chipathlon/jobs/scripts/sort_wrapper.sh
index 87439ccaaba90036b741d0f08890c1fb179734e0..5b8ff455c1713bae0fead025b01fb5cccd23bd1f 100755
--- a/chipathlon/jobs/scripts/sort_wrapper.sh
+++ b/chipathlon/jobs/scripts/sort_wrapper.sh
@@ -1,3 +1,4 @@
 #!/bin/bash
 
+cd $PEGASUS_SCRATCH_DIR
 /bin/sort -k 8gr,8gr "$1" | awk 'BEGIN{OFS="\t"}{$r="PEAK_"NR; print $0;}' > "$2"
diff --git a/chipathlon/jobs/scripts/zcat_wrapper.sh b/chipathlon/jobs/scripts/zcat_wrapper.sh
index 5d189ed535552b70d8f53cc0beb78f0dbe1ef438..8fc0ba4d96b807d539651a0b8ffe826a0de941ad 100755
--- a/chipathlon/jobs/scripts/zcat_wrapper.sh
+++ b/chipathlon/jobs/scripts/zcat_wrapper.sh
@@ -1,3 +1,4 @@
 #!/bin/bash
 
+cd $PEGASUS_SCRATCH_DIR
 /bin/zcat "$1" | awk 'BEGIN{OFS="\t"}{print $1,int($2),int($3),$4,$5,$6,$7,$8,$9,$10;}' > "$2"
diff --git a/chipathlon/jobs/wrappers/bedtools_wrapper.sh b/chipathlon/jobs/wrappers/bedtools_wrapper.sh
index bbfc47e4336a863fc4ece476b52770dfa7631258..1cd693333f9e39e0a321064c6fb06da399340871 100755
--- a/chipathlon/jobs/wrappers/bedtools_wrapper.sh
+++ b/chipathlon/jobs/wrappers/bedtools_wrapper.sh
@@ -1,5 +1,6 @@
 #!/bin/bash
 
+cd $PEGASUS_SCRATCH_DIR
 . /util/opt/lmod/lmod/init/profile
 module load bedtools
 bedtools "$@"
diff --git a/chipathlon/jobs/wrappers/bowtie2_wrapper.sh b/chipathlon/jobs/wrappers/bowtie2_wrapper.sh
index 6a63fcbfa148351b29b0f1c8d73acd912d63fe00..f23550efbf51c340030c7a7a8f645d31da0e8743 100755
--- a/chipathlon/jobs/wrappers/bowtie2_wrapper.sh
+++ b/chipathlon/jobs/wrappers/bowtie2_wrapper.sh
@@ -1,5 +1,6 @@
 #!/bin/bash
 
+cd $PEGASUS_SCRATCH_DIR
 . /util/opt/lmod/lmod/init/profile
 module load bowtie
 bowtie2 "$@"
diff --git a/chipathlon/jobs/wrappers/bwa_wrapper.sh b/chipathlon/jobs/wrappers/bwa_wrapper.sh
index 47f0780f8cb9cf5f96f3919cf02a3612259789f0..b1b75bf933c482aee6d8e084c53b325eade52dfb 100755
--- a/chipathlon/jobs/wrappers/bwa_wrapper.sh
+++ b/chipathlon/jobs/wrappers/bwa_wrapper.sh
@@ -1,5 +1,6 @@
 #!/bin/bash
 
+cd $PEGASUS_SCRATCH_DIR
 . /util/opt/lmod/lmod/init/profile
 module load bwa
 bwa "$@"
diff --git a/chipathlon/jobs/wrappers/macs2_wrapper.sh b/chipathlon/jobs/wrappers/macs2_wrapper.sh
index bc3238d1827370d17edf56480b6320c5f745d85b..cbeb3841e3b3ce0f02f2a34d25c6f37cde1a13b4 100755
--- a/chipathlon/jobs/wrappers/macs2_wrapper.sh
+++ b/chipathlon/jobs/wrappers/macs2_wrapper.sh
@@ -1,5 +1,6 @@
 #!/bin/bash
 
+cd $PEGASUS_SCRATCH_DIR
 . /util/opt/lmod/lmod/init/profile
 module load python/2.7 macs2
 macs2 "$@"
diff --git a/chipathlon/jobs/wrappers/picard_wrapper.sh b/chipathlon/jobs/wrappers/picard_wrapper.sh
index 92ffde26adc7e9b9ca0a6f819f28b138aab55a83..b897c97a0f1aa138710f4617462c207e5b315de4 100755
--- a/chipathlon/jobs/wrappers/picard_wrapper.sh
+++ b/chipathlon/jobs/wrappers/picard_wrapper.sh
@@ -2,6 +2,7 @@
 set -eu -o pipefail
 set -o pipefail
 
+cd $PEGASUS_SCRATCH_DIR
 . /util/opt/lmod/lmod/init/profile
 module load picard
 
diff --git a/chipathlon/jobs/wrappers/r_spp_nodups_wrapper.sh b/chipathlon/jobs/wrappers/r_spp_nodups_wrapper.sh
index bf96b43cfabcc679e8071b560d5bfb0ff9dd91be..fdce742d1e0c44a2a7d30417792a5e037d70e50d 100755
--- a/chipathlon/jobs/wrappers/r_spp_nodups_wrapper.sh
+++ b/chipathlon/jobs/wrappers/r_spp_nodups_wrapper.sh
@@ -1,5 +1,6 @@
 #!/bin/bash
 
+cd $PEGASUS_SCRATCH_DIR
 . /util/opt/lmod/lmod/init/profile
 module load R spp
 Rscript ${SPP_NODUPS} "$@"
diff --git a/chipathlon/jobs/wrappers/samtools_wrapper.sh b/chipathlon/jobs/wrappers/samtools_wrapper.sh
index b6cc153edef79230b6e84bad4e22b2a8ab8fc630..7ba5f0702f0814a56534fa42d86dc679b028895c 100755
--- a/chipathlon/jobs/wrappers/samtools_wrapper.sh
+++ b/chipathlon/jobs/wrappers/samtools_wrapper.sh
@@ -1,5 +1,6 @@
 #!/bin/bash
 
+cd $PEGASUS_SCRATCH_DIR
 . /util/opt/lmod/lmod/init/profile
 module load samtools
 samtools "$@"