Fix issues for submitting to CRAN