fixes for running tests on python2.6