Clean up invalidated nodes after traversing the whole root, avoid invalidating nodes w/o model , MPS-19272