Made changes according to 2to3.