py3 fixes all over the place