Minor optimizations to getNodeList().