Fix Python code