Incorrect JSON file writing behavior in model duplication.