Better error messages for invalid values.