fixes for py3 compat