Support clone
Check params, add (failing) test for repeat_n_sum_k.
xfree is recommended according to documentation