Fix tests under python 3.1