Final fixes for py3 compat