minor R code cleanup