Rcpp related functions Fixed