Fixing error handling for when specifying an invalid value.