Port to python 3
Tweaks