Fix bug where inserting other places than the last would corrupt the queue.