Made writing of unknown values conditional, with appropriate default.