Here are some small changes to make it work with python3

I'm working on packaging authprogs for Fedora and thought it would be nice to also support python3. Ends up the changes aren't very big.