Test that target conditions are correctly removed on document destruction.
This test passes if it does not crash