pep8 and pyflakes fixes

Change-Id: I80c669b9667cfa3897c3bf373bd656c771e02b8f