Fix a Python 3 issue.

Reported by jhofmann, part of #21.