Make pylint happier.

Remove an unused import and variable, make lines shorter, etc.