Updated tests. Still only partial support for variable number of nodes. WriteLoopTests are not complete bug-free