Fix incorrect dirty flag when initializing from JSON #151