Fixing an R issue