Cleanup: fix pylint warnings and errors