Fix NPE deleting last item in queue.