Implemented clearing reference properties.

With a unit test.