Audit and small fixes to node/text splitting code