Some python code cleanup.