various fixes in master.py and virt.py