cast values for consistent validation