Fix problem migrating to Python 2.7