More fixes to bugs found by PyLint.