In previous implementation one excess element could be added to the chain. Add previous sibling presence check to prevent this. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>