Fixed a bug with remove.