Updated patch to r