Fixes tests for python 2.6, 2.7 and 3.2