minor fixes in python code