More Python 3 unicode compatibility fixes