Replaced all nsamples by size(c.samples, 1)