Fixed an issue with calling the wrong function when removing an item