Fix a bug with :HAS in subnodes and index