Fixed bug pertaining to removing element.