fix node index displacement by null/undefined nodes