Took me a long time to figure out what was wrong, maybe this will help others.
The fix is in this PR: the code