Actually merged changes for Python 3 support.