Replaced most auto_ptr with unique_ptr.