Fixed PEP8 and pyflakes issues.

Fixed some quality issues introduced in last commit.