Restore Python 2.6 compatibility.

Avoid breaking Python 2.6 compatibility with these minor changes.