 +            _download_and_extract
 +        else
 +            log "Downloading $SRC"
-+            exec_and_log "$CURL -k -o $DST_PATH $SRC"
++            exec_and_log "$CURL -k -o $DST_PATH $SRC" \
++                "Error downloading $SRC"
 +        fi
 +        ;;
-+    
+ 
 +    pdisk:*)
 +        log "Persistent disk handling $SRC $DST"
-+        exec_and_log "sudo /usr/sbin/attach-persistent-disk.sh $SRC $DST_PATH"
-+        ;;
-+    
++        exec_and_log \
++            "sudo /usr/sbin/attach-persistent-disk.sh $SRC $DST_PATH" \
++            "Failed to create persistent disk $DST_PATH"
++        ;;
++
 +    *)
 +        log "Cloning $SRC_PATH"
-+        exec_and_log "cp -r $SRC_PATH $DST_PATH"
++        exec_and_log "cp -r $SRC_PATH $DST_PATH" \
++            "Error copying $SRC to $DST"
 +        ;;
 +    esac
 +}
- 
--exec_and_log "chmod a+rw $DST_PATH"
++
 +_download_and_extract
- 
++
 +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 b079622..ac6c2b7 100755
+index f211024..ae44a47 100755
 --- a/src/tm_mad/nfs/tm_context.sh
 +++ b/src/tm_mad/nfs/tm_context.sh
-@@ -59,6 +59,8 @@ done
- 
- exec_and_log "$MKISOFS -o $DST_PATH -J -R $ISO_DIR"
+@@ -62,6 +62,8 @@ done
+ exec_and_log "$MKISOFS -o $DST_PATH -J -R $ISO_DIR" \
+     "Error creating iso fs"
  
 +exec_and_log "chmod o-rwx $DST_PATH"
 +

+exec_and_log "ssh $DST_HOST chmod ug+w,o-rwx $DST_PATH"
 
diff --git a/src/mad/sh/scripts_common.sh b/src/mad/sh/scripts_common.sh
index 3127108..9ab2bf4 100755
--- a/src/mad/sh/scripts_common.sh
+++ b/src/mad/sh/scripts_common.sh
@@ -32,6 +32,9 @@ SED=/bin/sed

+exec_and_log "$SSH $DST_HOST chmod ug+w,o-rwx $DST_PATH"
 
diff --git a/src/tm_mad/nfs/tm_clone.sh b/src/tm_mad/nfs/tm_clone.sh
index 62c33fc..ac02b02 100755
--- a/src/tm_mad/nfs/tm_clone.sh
+++ b/src/tm_mad/nfs/tm_clone.sh
@@ -41,21 +41,53 @@ 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" \
-        "Error downloading $SRC"
-    ;;
+function _download_and_extract () {
+    case $SRC in
+    http://*.gz|https://*.gz)
+        log "Downloading GZip archive $SRC"
+        exec_and_log "download_and_extract $SRC $DST_PATH.gz $GUNZIP" \
+            "Error downloading $SRC"
+        ;;
 
-*)
-    log "Cloning $SRC_PATH"
-    exec_and_log "cp -r $SRC_PATH $DST_PATH" \
-        "Error copying $SRC to $DST"
-    ;;
-esac
+    http://*.bz2|https://*.bz2)
+        log "Downloading BZip2 archive $SRC"
+        exec_and_log "download_and_extract $SRC $DST_PATH.bz2 $BUNZIP2" \
+            "Error downloading $SRC"
+        ;;
 
-exec_and_log "chmod a+rw $DST_PATH"
+    http://*|https://)
+        LOCATION=$(python2.6 $(which stratus-manifest) --get-element location $SRC)
+        rc=$?
