Fixed compatibility with py-2.6