Added input validation to TypeRegisty