Added method to check for the type of a value.