Make the print and cat functions more null-safe.