Use the directory where the configure.sh script lives
Fix several issues