Further Python 3 migration