Fix issue with nested object keys.

Refactor recursive field checking method.