Improve PEP8 compatibility

Fixed all flake8 reported issues.