Modifying the code responsible for setting nodes so it correctly sets their type