python 2.6 support, tests and fixes