Fix tests on Python3