Fix a bug that returns true when an object or a destroy function is already set.