Python code cleanup.