Fixes to make code work under python3
Merge pull request #1 from rkuska/master

Fixes to make code work under python3