Cleaned up code to reduce pylint warnings.