Misc fixes

If you are going to maintain this please pull these changes, basically they make the tool working with python 2.6 and relax some requirements.