Fix python 3 errors in models