fix indentation
update invalid syntax in python3
more python3 fixes
fix tests