Fixes for the StringIO import make it 2to3 friendly.