Hi @lpalma,
I have fixed the function and added a test using the example in #8.
Could you take a look or run your case to confirm it works as expected?
Cheers,
Núria