Fix failing tests syntax

Various PEP8 fixes, an if statement correction and removed some stale code in a code comment