Fixed compatibility of some scripts with python 2.6