Fixed a bug in fromJson and changed it so that set values are flagged as modified.