ignore the CDPATH value at "cd" and add more error checks

Hopefully this change will fix the build for alonzotg.

For compiling and running KTechlab, the following commands should be enough:

sh simple-setup.sh
sh simple-launch.sh