Update kdTree.js

When `content.length` is less than `maxNodes` then that line would fail.