Fixed NULL pointer when object is declared on the stack and killed.