Bugfixes, tests and more code.
More relationship updates.