Found and fixed another bug with collapsing: collapsing function was waiting for the wrong number of nodes to be on the screen before restarting the force layout, as it was not compensating for nodes that would not be removed from the screen (as a result of owning parents being still on screen.)