(#1356) Fix end of changes detection