Bug fix => Initialize rapp
More bug fixes => set srcid outside of if
Bug fixes => replace set with concat
Print iff nsamples is greater than zero.