Fixed the assignment of the unique_ptr.