Replace auto_ptr by shared_ptr.

The auto_ptr caused a compiler warning for me.