Fix auto_ptr is deprecated warnings