Ensured properties are cleared before being written to.

This stops them being duplicated or appended when changed.