Make sure positional operator $ is not used for nested arrays.

Fixes issue #3696.