Fixed a bug with double removal.