a few small fixes are enough to ensure python2.6 compatibility