Fixed wchat_t cast bug