Update R code with additional minor changes to python code.