Bugfix for document node index in unique method