Fix unit tests for py3.