Fixes for python 3