Fixed (#841)

This is a fix for #841 and supporting test.
Our comments crossed in the air ;-)