Fix broken tests in Python 2.6