fixes for bugs that pylint found