I thought you usually preferred checking has_keys or something for this rather than explicitly type-checking?