see commit description

Hi Vitaly,

got a few bug to maintain.