Fixed removal of elements