PEP-8 polish: Correct some inconsistent indentation, remove trailing spaces, remove superfluous semicolons/parans. Make code more pythonic