diff --git a/.gitlab/rel_eng/recompress-all b/.gitlab/rel_eng/recompress-all
index 2eea72d49f2a4319a2678c87edd5caccaa0b7ceb..1a4b58af3bcc6a6315371ce61fce4b1d9d1a5ffc 100755
--- a/.gitlab/rel_eng/recompress-all
+++ b/.gitlab/rel_eng/recompress-all
@@ -21,9 +21,10 @@ usage :
 
 %.zip : %.tar.xz
 	echo "[tarxz->zip] $< to $@..."
-	tmp="$(mktemp tmp.XXX)" && \
+	tmp="$$(mktemp tmp.XXX)" && \
 		tar -C "$$tmp" -xf $< && \
 		cd "$$tmp" && \
 		zip -9 -r $@ * && \
+		cd .. && \
 		rm -R "$$tmp"
 
diff --git a/.gitlab/rel_eng/upload.sh b/.gitlab/rel_eng/upload.sh
index 4550bf4ceacd944f01c387c1124c755f18ad4577..4940d47f2ade2679f43275759fd6ae227791bf7d 100755
--- a/.gitlab/rel_eng/upload.sh
+++ b/.gitlab/rel_eng/upload.sh
@@ -145,7 +145,7 @@ function purge_all() {
     curl -X PURGE http://downloads.haskell.org/~ghc/$dir
     curl -X PURGE http://downloads.haskell.org/~ghc/$dir/
     for i in *; do
-        purge_file $i
+        purge_file "$i"
     done
 }
 
@@ -158,9 +158,9 @@ function purge_file() {
     )
 
     for dir in ${dirs[@]}; do
-        curl -X PURGE http://downloads.haskell.org/$dir/$i
-        curl -X PURGE http://downloads.haskell.org/$dir/$i/
-        curl -X PURGE http://downloads.haskell.org/$dir/$i/docs/
+        curl -X PURGE http://downloads.haskell.org/$dir/$1
+        curl -X PURGE http://downloads.haskell.org/$dir/$1/
+        curl -X PURGE http://downloads.haskell.org/$dir/$1/docs/
     done
 }
 
@@ -213,7 +213,7 @@ function recompress() {
         needed+=( "$(basename $i .tar.xz).zip" )
     done
 
-    recompress-all -l ${needed[@]}
+    recompress-all -j10 ${needed[@]}
 }
 
 function upload_docs() {