fixed remove() and empty()