Test found a dangling pointer bug. Fixed.