Fix bugs in build.py on new host