Fix python2 compatibility