debug index out bounds due to rcpp 0.10