More Python 3 compat and regression fix