Fix smart pointer type, auto_ptr -> shared_ptr.