Fix tests on python 3