Merge pull request #1081 from haberman/fix-py3

Fixes for Python 3.