Added optional length argument to 'UTF16ToString' function from preamble.js