Slight tweaks to r port.