Fixed bug in remove method