fix some python3 syntax errors