Fix issues with the build script