Python3

fixes for python 3 related issues