More fixes to Python 3 support.