Fix python3 migration