Fix failing tests on Py3