We were misusing writeStringToMemory which could cause memory corruption.