adopted a workaround for a bug bug in the current version of Rcpp