When the history was empty, the ‘don’t re-insert’ logic was breaking, because the beginning and end of the vector range were equivalent.