use-after-free fixes.