Update retrieve.rcm.R

Most bugs seem to be fixed and retrieve.rcm seems to work.