Fix unit tests on python 3+.