Fix handling of pointers when looking up paths in an array or map

The array fix isn't tested, but it parallels the map fix.