Update functions and documentation to pass R CMD Check