Minor fixes for R CMD check
Change env of function rather than using :::