Allow traversing dicts nested with lists when matching

Resolves #13672.