Fixed an UnicodeEncoding issue that sometimes arose