Python 3 support for migrations
Minor coding style fix