Bug fix for Python 2.6 compatibility
Bug fix for Python 3.x compatibility