Fix the tests for Python 3