Changed Generic WriteValue to just use Marshal