Check if rval type value is valid + unit check

fixed some typo errors.