fixed a couple bugs in python scripts