Clean up attribute unbinding

Also, add a test.

[Delivers #83698142]