Finalized the loop node with more unit tests.