Fix test-harnesses and generator to work with new relation structure.