Note that you should run setup.sh with bash, in case it's not executable (unzipped from a zip file, etc.)
Fixed top level directory detection when run as: bash setup.sh