Improved unit tests and minimal distance for nodes.