add fail check to init.sh, more robust finding of its path
tweaks for C++