Fix wchar_t cast