Fixed a bug with the order of remove events.