Python 3.2 and portability fixes.