Lifetime tests and fixes.