Tidyup.
Fix some potential problems identified by pylint.