*8787* Improve robustness of build scripts