to_array(undef) is converted to NA