Bugfix for non-optional fields being tested for having a value

At present there's a bug where fields that are not 'required' are incorrectly tested for the presence of a value. The documentation states that optional fields are only tested when they have a value present, but this isn't the case. This will fix that.