Changes to allow compilation against Python 3.