Change findMarker() usage to handle missing text ranges. Exit properly when undo stack reaches original changeGeneration in history.