Fix test failures on py3.