Fix pylint issues and pep8, plus review comments