Fixed the test failures for Python 3.