returning unitialized SEXP on error crashes R