More Python 3 syntax fixes