R integration, minor tweaks