Thanks for the explanations. Here's a new patch.