fix py3 compat issues