fix bug in rcpp code