fix bugs in python files