Fixed crash on registry valie write