Adding __toString support to the type() function