Changed indexing in getRMatrix
Merge remote-tracking branch 'origin/master'