 +if [ -e $DST_PATH ] && [ ! -L $DST_PATH ]; then
 +  exec_and_log "chmod ug+rw,o-rwx $DST_PATH"
 +fi
+
 diff --git a/src/tm_mad/nfs/tm_context.sh b/src/tm_mad/nfs/tm_context.sh
 index f211024..ae44a47 100755
 --- a/src/tm_mad/nfs/tm_context.sh

 
 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 "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..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"
