Fix python 3 issues