More fixes for Python3