Fix tests.
Refactor node retrieval.