Fixes for bild.py

midway I gave up making it general to make it useful for me as I ran out of time.