fix py 2.6 compatibilty
Merge pull request #80 from sanga/py26compat

Restore some py2.6 compatibilty. Closes GH-79.