Fix deleting unique_ptr