Fix python2.7 tests