Fix a python bug