Fixing python parsing errors