Added python3 compatibility

Just little changes for an initial compatibility with Python3, which I'm using on Arch :)