Avoid fatal errors caused by null values in __toString