More test fixes for Python 3