fixed a number of bugs in mkfq.py