Fix incorrect dirty flag when initializing from JSON #151

Fix incorrect dirty flag when initializing from JSON 
#151 
#173