Various fixes for R CMD CHECK.