Fixed mimatched new[]/delete when using auto_ptr.