Modified conversion of wide-char to unicode to use correct length, fixing a bug that was causing null characters to be included in the returned string which was then causing inconsistent equality comparisons down the line.