Some minor changes to the way we detect R.