Small fix for reducing chances of dangling pointers.