Ensure modified date is set in all scenarios we'd want it set.

This now includes when the object is being replaced, or modified date is just missing but does exist on the object.