Python 2.6 compatibility

Fixing Python 2.6 compatibility