My previous patch would not work. I attach a corrected version which fix the issue.