fix most of the test for python3