Fix R CMD CHECK warnings for missing functions and globals