Fix handling of value attributes

The previous fix contained a bug that tested the presence of the value
property incorrectly.