Minimum update to work on Python 3. Some PEP8.