Python 3 fixes for last commit