Fix bug in test under Python 2.7.