Fix tests for Python3.