CForestSampler now copies the states to sample and related changes