Lot of stuff but a huge fix in rcpp_sim.h