Build script updates picked from v0.9