bug fixes in build.py