Fix a bug with destroy_all_with_callbacks.