Fix unit tests in Python 3