Coerce R vectors when necessary