Fix new code to be Python 3 compatible.