Correctly reset lastEntry