@lazedo - I am not sure be46742 is actually effective and fixes anything -- `first` should become NULL if the last item in the slot (entry) is removed, because it->next should be NULL at that moment.
Can you describe what was the issue you faced? Maybe the problem is in another part and it->next is wrong, but that will have bad effects in other cases.
The commit 18ba95a seems ok.