Fixed getNodeIndex and changed its name to getCorrectNode