 +exec_and_log "chmod ug+w,o-rwx $DST_PATH"
  
 diff --git a/src/tm_mad/ssh/tm_clone.sh b/src/tm_mad/ssh/tm_clone.sh
-index 71800d1..e26b8cf 100755
+index 71800d1..eaa5f93 100755
 --- a/src/tm_mad/ssh/tm_clone.sh
 +++ b/src/tm_mad/ssh/tm_clone.sh
 @@ -43,19 +43,51 @@ log "Creating directory $DST_DIR"

 
 fix_paths
 
-log "$1 $2"
-log "DST: $DST_PATH"
+log_debug "$1 $2"
+log_debug "DST: $DST_PATH"
 
 DST_DIR=`dirname $DST_PATH`
 
 log "Creating directory $DST_DIR"
 exec_and_log "mkdir -p $DST_DIR"
-exec_and_log "chmod a+w $DST_DIR"
+exec_and_log "chmod ug+w,o-rwx $DST_DIR"
 
-case $SRC in
-http://*)
-    log "Downloading $SRC"
-    exec_and_log "$WGET -O $DST_PATH $SRC"
-    ;;
+function _download_and_extract () {
+    case $SRC in
+    http://*.gz|https://*.gz)

+        exec_and_log "download_and_extract $SRC $DST_PATH.gz $GUNZIP" \
+            "Error downloading $SRC"
+        ;;
+
+    http://*.bz2|https://*.bz2)
+        log "Downloading BZip2 archive $SRC"
+        exec_and_log "download_and_extract $SRC $DST_PATH.bz2 $BUNZIP2" \
+            "Error downloading $SRC"
+        ;;
+
+    http://*|https://)
+        LOCATION=$(stratus-manifest --get-element location $SRC)
+        rc=$?
