tostr added (with a little inefficiency to avoid problems converting a string
into a string)