Fixed Py3 compatibility issue in test suite