Fix the same bug in __setitem__ and __delitem__