Fixed a test failure on py3