Fixing up some R stuff