Close #2043 - fix issue with removing last element in collection