more Python3 syntax fixes