Fix tests on python versions other than 2.7.