Modify for Python 3.