More bugs solved on the R code.