Changes to pass CRAN check