Add some python 2 compatibility stuff.