Fix PEP8 and pyflakes warnings.