Fixes for Python 3, Python 2 compatibility not maintained.

This seems to be changes needed for Python 3, not sure if you had a strategy, but I needed support.