fix some pep8 and pylint errors ('#[^[:blank:]' becomes an error)