Compatibility changes for python 2.4

Updated files that use Python 2.x to be compatible with Python 2.4.