Add a function to remove an item from a map, checking for existence