Many bugs with wrong nodes being connected are fixed