Use ScopedPointer instead of deprecated auto_ptr