Fix py32 compatibility issues