when value is null, don't check parent, added test, fixes #397

Issue #397.