Seems like I've been using a slightly outdated version, I just read this:
"Please note the following breaking changes since r126:
In some rare cases, pick by UID can act differently. This should be easily resolved by adding a 'for each' loop above the condition."
I updated to r132, the bug seems to have been fixed. Now it works great without any change in the code (I didn't even add a "for each" loop). Thank you both for your answers and sorry for alerting you for an outdated bug.