Cleaned up code so passes pylint.