Fixed bugs handling paths in the shell scripts.