Changed Unicode fix so that it works in both Python 2 and 3.