index: handle empty nodes and the 0-width space