Fix potential issue with 0-sized nodes