Fixed an error that caused segmentation fault when the last item of a container queue item is removed and a new one is added there later on.