more fixes for python3 syntax errors