pnd_run.sh: Applied patch by Paul Brook (pbrook) to fix the broken