More work on py3 compat, not ready yet