Fix tests so they work with R CMD check