Added check for nodeType in getIndexedNode