Change auto_ptr to unique_ptr, as requested by Chris Jones