fix errata and revise build script