Fixed python 3 issues