Ensure compatibility with python2