Fixed indexed nodes in root element not being correctly selected