Fixed a bug when erasing an element in the "next" list. (The behaviour of erasing an elemet in a vector and the behaviour of erasing an element in a list seem to be different, however, the returned value is the same in both case.)