Changes for python 2.6

I don't like these changes - they make the code harder to read - but
they are necessary to get it to run on Python 2.6 and earlier,

However, I think I may have broken something.