Fixed up dangling pointers