Updating code to reflect new changes in stable Python branch.