Rcpp helper scripts