Fix issues in the build script when runned locally