more py3 fixes/workaround