Back-fixes to maintain Python 3 compatibility.

All nosetests + doctests pass under Python 2.7.8 and 3.4.1.