Fixed Python 3 incompatible migration