Fix issues when serializing dirty properties

Change-Id: Ibe13789eef7b13996a45051d5e8f4e59a2e2d2b6
Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>