Fix ordering of nodes in sequence