Hi Evgeny, thanks a lot for the analysis and the patch, I just applied it.
If you can, please use git format-patch when submitting patch and make sure the subject line of the email containing the patch is a short description of it -- it will help me a lot. Best, -- Bastien