Fix for bug where objective was deleted during component replace.

Fix for bug where objective was deleted during component replace.