Improved support for Python 3.