fixed couple of pyflakes and pep8 issues