build script: some fixes