Py3 fixes

This picks up where #8 left off.