Made TO_ATOM() recursive.