Fix running build.sh from other directories
Fix running from a directory whose name contains space