Ok after debugging this on Sebastian's setup, I'm attaching a new patch which seems to work. Thanks Sebastian for your help.