python 3 fixes and other stuff relating to issue #2