Fixed broken tests on Python 3 after 3c5fc708f1a8f60c05182869f6f3ec13697bbcf2.