Adjust to work with py2.5 and py2.6
More adjustments for older python versions