--- Scripts/bin/UnionSandbox	2007-08-10 21:27:37.000000000 +0200
+++ MyTools/1-Oct-2007/Scripts/bin/UnionSandbox	2007-10-01 11:40:50.000000000 +0200
@@ -94,7 +94,11 @@
     then
 	writedir=`Entry "writedir"`
 	Log_Normal "Moving entries to: $writedir"
-	Assert_Dir $writedir
+
+	# $writedir could countain entries from old failed Compilations, remove it.
+	# Maybe could be added a function: Assert_New_Dir in Functions/Files
+	[ -d $writedir ] && rm -rf $writedir && mkdir -p $writedir
+
 	cp -ra "$sandbox_rw/." "$writedir"
 	Quiet mv $sandbox_mp/* $writedir
     fi
@@ -150,6 +154,11 @@
     rhs=$(echo $each | cut -d= -f2)
     Assert_Dir $lhs
     Assert_Dir ${sandbox_mp}$rhs
+	# Bind Symlinks to directories under mp sandbox, needed for the sandbox in detached programs
+	if Is_Link ${sandbox_mp}$rhs;
+	then
+		rhs=`readlink ${sandbox_mp}$rhs`
+	fi
     mount -o bind $lhs ${sandbox_mp}$rhs 
     [ "$?" = "0" ] || error=true
     '
