fix suggested by @kevinushey on Rcpp