Corrections to pass R CMD check