update to python 3.x and minor bugfixes