Fix PEP8 and Pyflakes problems