Replacing all uses of the deprecated auto_ptr with unique_ptr to appease all compilation warnings.