Fix py26

This should fix all the issues for python 2.6

@ashishbhate: can you check whether this fixes everything for you ? See PR #4