More changes to get Python 3 behavior correct.