Fixed issue in RFunction