Fix nodeCount bounds checking, listDir completeness.