Fixes 2 known incompatibilities with Python 2.6