Fixed imports for python 3
Fixed encoding errors for Python3