Fixes to pass the CRAN check