Fix for compatibility issues between Py3k and Py2.X strings