diff --git a/scripts/check_grid_file_atlcvmfs.sh b/scripts/check_grid_file_atlcvmfs.sh
index be7cc4d48bfdafd96f286ca519ddf40ba5f82e77..f3d30f9ae88561f344e8e44fd482850838c2f3d4 100755
--- a/scripts/check_grid_file_atlcvmfs.sh
+++ b/scripts/check_grid_file_atlcvmfs.sh
@@ -32,6 +32,8 @@ for file in "${changed[@]}" ; do
   relLink=0
   while $(test -L $link) ; do
     link=$(readlink $link)
+    # Jump to the directory where the parent link is located
+    cd $(dirname $link) 2> /dev/null
     let relLink=$relLink+1
     if [ $relLink -gt 10 ] ; then # This should never happen, but you never know...
       echo "ERROR: file $file is a link that points back to itself"
diff --git a/scripts/check_grid_file_size.sh b/scripts/check_grid_file_size.sh
index 5551261deb6970f274fda2ba7691ad0fa79ffbc5..77bab03ba7a2ffac4eaeb4e7f41dacf7d280ae0e 100755
--- a/scripts/check_grid_file_size.sh
+++ b/scripts/check_grid_file_size.sh
@@ -32,6 +32,8 @@ for file in "${changed[@]}" ; do
   relLink=0
   while $(test -L $link) ; do
     link=$(readlink $link)
+    # Jump to the directory where the parent link is located
+    cd $(dirname $link) 2> /dev/null
     let relLink=$relLink+1
     if [ $relLink -gt 10 ] ; then # This should never happen, but you never know...
       echo "ERROR: file $file is a link that points back to itself"
diff --git a/scripts/run_athena.sh b/scripts/run_athena.sh
index 332e92e6b9e0a5c6a9b62e46ee9244a2e1c42675..9fd402b7cdd2288cff77f067c3f21bf2aa21b9aa 100755
--- a/scripts/run_athena.sh
+++ b/scripts/run_athena.sh
@@ -76,6 +76,7 @@ for dir in "${dirs[@]}" ; do
   # Create a temporary directory from which we will run athena
   mkdir tmp_$DSID
   cd tmp_$DSID
+  TMP_DSID_DIR=$PWD
 
   # If there is a GRID file then copy it to the directory where we run athena
   GRIDfile=$(ls ../$DSID/*.GRID.tar.gz 2>/dev/null)
@@ -85,12 +86,16 @@ for dir in "${dirs[@]}" ; do
     relLink=0
     while $(test -L $link) ; do
       link=$(readlink $link)
+      # Jump to the directory where the parent link is located
+      cd $(dirname $link) 2> /dev/null
       let relLink=$relLink+1
       if [ $relLink -gt 10 ] ; then # This should never happen, but you never know...
         echo "ERROR: file $GRIDfile is a link that points back to itself"
         exit 1
       fi
     done
+    # Go back to DSID directory where we started
+    cd $TMP_DSID_DIR
     
     echo "INFO: GRID file $GRIDfile will be copied from $link"
     GRIDfilename=$(basename $link)