Changed unique_ptr_to_optional so that it takes an optional unique_ptr