refinements to the memory leak fix that avoid tripping consistency check in the findrtext