Fix flake8, Pylint warnings