Incorporated suggestions from pyflakes and pylint.