Update for python 3 compatibility

Encode a checksum explicitly and fix a typo in setup.py.