Fix python 3 errors