Pylint errors

@nedbat @jzoldak: This should drop the number of pep8 and pylint errors (some of which were introduced by #269)