Fix problems detected by R CMD check