Fix disallowed writing logic.