Fix a bug introduced by r9495 in which we try to write temporary NULs