Monkey patches to make tests run on Python 2.6