Fix unicode related error in python 2.7