Fix tests for compatibility with Py3.