Test and implement correct checking of nested object properties