Fix issue with test cases in Python 3