Updates to build.R to ensure reproducibility