Cast name in __toString method to avoid error when empty