fix some python code