Fixed the usage of NaN as a string encoding.