fix some python 3 changes