Fixed isDirty check. If _isDirty was set to true, subsequent "set" calls could potentially revert it to false, which would prevent the "save" function from persisting data to the database.