handle nulls and unexpected SEXP types gracefully in rownames